This is likely to work on other Samsung devices as well, when I get around to it I will try it on some more devices.
1. Transfer the .jad and .jar files to the phones memory to the ‘Other Files’ folder.
You can transfer the files from Samsung PC Studio’s ‘Phone Explorer’, or just transfer it straight to the memory card and move it to ‘Other Files’ from the phone’s menu.
(If you don’t have a .jad file, you can download ‘Jad Maker’ (google) and make a new one)
2. Exit all menus and type in this code: *#9998*4678255#.
You should now get a ‘Activated’ message. Java install is enabled.
3. Go to the ‘Other Files’ folder and select the .jad file (should be 1kb).
Press ‘Options’ (left soft key) and you should get a ‘Do you want to install’ question.
Press ‘Yes’ to install.
4. To deactivate Java install, simply type the same code again.
You should now get a ‘Deactivated’ message.