How to install JDK in LINUX

Source: Internet
Author: User
How to install JDK in LINUX-general Linux technology-Linux programming and kernel information. 1. Download JDK1.6 from the sun website.

Download and select JDK for LINUX

Http://download.java.net/jdk6/

2. Enter

Sh jdk-6u2-linux-i586-rpm.bin

3. Check that the installer is on the page asking if you want to abide by the license agreement. Press enter and enter a space.

A line appears: Do you aggree to the above license terms? [Yes or no]

The installer asks if you are willing to comply with the license agreement you just saw. Of course you have to agree. Enter "y" or "yes" and press Enter.

4. Enter the following in the command line:

Vi/etc/profile

Add the following content to it:

Export JAVA_HOME =/usr/java/jdk1.6.0 _ 02
Export JAVA_BIN =/usr/java/jdk1.6.0 _ 02/bin
Export PATH = $ PATH: $ JAVA_HOME/bin
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME JAVA_BIN PATH CLASSPATH

5. Go to the/usr/bin/directory.

Cd/usr/bin

Ln-s-f/usr/java/jdk1.6.0 _ 02/jre/bin/java

Ln-s-f/usr/java/jdk1.6.0 _ 02/bin/javac

6. Enter

Java-version

Screen output:

Java version "jdk1.6.0 _ 02"
Java (TM) 2 Runtime Environment, Standard Edition (build jdk1.6.0 _ 02)
Java HotSpot (TM) Client VM (build jdk1.6.0 _ 02, mixed mode)

7. JDK1.6 installation is complete.

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.