The following is the building SUNJAVA configuration steps under Ubuntu10.04 install open-jdk-6, sudoapt-getinstallopen-jdk-6 (I do not know why not install this can not run java and javac command !!!) Download the jdk-6u20-linux-i586.bin file from Oracle to copy the jdk-6u20-linux-i586.bin to the/usr/lib/jvm/java folder
The following describes how to configure sun java in Ubuntu 10.04.
Install the open-jdk-6, sudo apt-get install open-jdk-6 (I don't know why this doesn't run java and javac commands !!!)
Go to Oracle official website to download jdk-6u20-linux-i586.bin files
Copy the jdk-6u20-linux-i586.bin to the/usr/lib/jvm/java folder
Run sudo chmod a + x jdk-6u20-linux-i586.bin
Run sudo./jdk-6u20-linux-i586.bin
Press enter until yes/no is displayed. Then, enter yes and press Enter. The jdk1.6.0 _ 20 directory is displayed. Www.linuxidc.com
OK. jdk has been installed.
Run the code on the terminal: sudo gedit/etc/environment
Add the following variables:
JAVAHOME =/usr/lib/jvm/java/jdk1.6.0 _ 20
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/java/jdk1.6.0 _ 20/bin"
CLASSPATH =.:/usr/lib/jvm/java/jdk1.6.0 _ 20/lib
Next, set the default jdk. because another jdk may exist by default, run the code on the terminal:
Sudo update-alternatives -- install/usr/bin/java/usr/bin/jvm/java/jdk1.6.0 _ 20/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/usr/bin/jvm/java/jdk1.6.0 _ 20/bin/javac 300
Enter sudo update-alternatives -- config java and select the corresponding jdk
Enter java-version to check whether it is sun's jdk. So far, sun-jdk has been successfully installed.