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