Summary of JDK installation in Ubuntu

Source: Internet
Author: User
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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.