Installing JDK and Eclipse under Linux

Source: Internet
Author: User
Tags gtk

Installation steps:

(1) Download JDK

(jdk-8u20-linux-x64.tar.gz)

(2) Uninstalling the system's own open source JDK

Rpm-qa |grep Java

Rpm–e Java

(3) Copy the installation files to the user directory

For example:

Under the/opt/java directory

(4) Unzip the file

TAR–XZVF jdk-8u20-linux-x64.tar.gz

After decompression, in the/opt/java directory will generate a new directory jdk1.8.0_20, which is stored in the extracted files.

At this point, the installation is basically done, and here are the settings for the environment variable.

Note: If the file you downloaded is in RPM format, you can install it by using the following command:

RPM-IVH jdk-8u20-linux-x64.rpm

(5) Environment variable setting

There are 2 ways to configure the environment variables:

① modify the. bashrc file or the. bash_profile file, add the following statement to the file:

Export JAVA_HOME=/OPT/JAVA/JDK1.8.0_20

Export path= $PATH: $HOME/bin: $JAVA _home/bin: $JAVA _home/jre/bin

Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib

Ii

Modify the. Profile file (this is recommended so that other programs can also use the JDK in a friendly way)

Vi/etc/profile

Locate the export PATH USER LOGNAME MAIL HOSTNAME histsize INPUTRC in the file, and change to the following form:

Export JAVA_HOME=/OPT/JAVA/JDK1.8.0_20

Export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin

Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib

(6) Make the environment variable effective

Execute the configuration file to make it effective immediately

Source/etc/profile

Then execute the following command to verify that the installation is successful

Java-version

If the following message appears, the installation is successful

------------------------------------------------------------------------------------

1.

Useradd Eclipse:eclipse

passwd Eclipse

2.

MV eclipse-jee-indigo-sr2-linux-gtk.tar.gz/opt/

3.

Su-eclpse

TAR-XZVF eclipse-standard-luna-r-linux-gtk-x86_64.tar.gz

4.

VI. bash_profile

Export JAVA_HOME=/OPT/JAVA/JDK1.8.0_20

Export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin

Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib

source. bash_profile

5.

/opt/eclipse/eclipse

6.

Export display=172.16.0.1:0.0

/opt/eclipse/eclipse

Installing JDK and Eclipse under Linux

Related Article

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.