Summary of JDK installation in Ubuntu
Install JDK in Ubuntu using jdk-6u45-linux-x64.bin as an Example
1. Download JDK. I use a jdk-6u45-linux-x64.bin.
2. Place the downloaded jdk-6u45-linux-x64.bin to your designated location, such as/usr/Java/JDK
3. $ Sudo-S./jdk-6u45-linux-x64.bin one way press enter until installation is complete
4. $ sudo gedit/etc/profile
Add
# Set Java environment
Java_home =/usr/Java/JDK/jdk1.6.0 _ 45
Export jre_home =/usr/Java/JDK/jdk1.6.0 _ 45/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path
5. restart the computer to test the JDK version. The Java-version displays the installed version number, indicating that the installation is successful.
[Supplement 1]
I. The following are environment variables for Linux configuration.
1. Modify the/etc/profile file (Global Users)
VI this file/etc/profile
Add the following content to the end of the profile file:
Export java_home =/usr/share/jdk1.6.0 _ 20
Export Path = $ java_home/bin: $ path
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
2. Modify the. bash_profile file (a user can use these environment variables)
Add the following content to the end of the. bash_profile file:
Export java_home =/usr/share/jdk1.6.0 _ 20
Export Path = $ java_home/bin: $ path
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
3. Run the following command on the shell terminal: (for temporary use)
Export java_home =/usr/share/jdk1.6.0 _ 14
Export Path = $ java_home/bin: $ path
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Ii. Uninstall JDK
· Find the _ uninst subdirectory of the JDK installation directory.
· Run the command./uninstall. Sh on the shell terminal to uninstall JDK.