Beginner Linux on the road encountered a variety of pits to share the correct installation of the JDK
1. Prepare the JDK installation package first I downloaded the jdk-7u79-linux-x64.tar.gz.
2. Create a Java folder under/usr/local
Mkdir/usr/local/java
3. Unzip the file in your directory and move it to the Java directory
TAR-ZXVF jdk-7u79-linux-x64.tar.gz MV Jdk1.7.0_79/usr/local/java
4. Go to the ETC directory and locate the profile file for editing.
CD/ETC VI Profile
Press I to enter edit mode to enter the file at the bottom
Export JAVA_HOME=/USR/LIB/JVM/JAVA7 export JRE_HOME=${JAVA_HOME}/JRE export Classpath=.:${java_home}/lib:${jre_hom E}/lib Export Path=${java_home}/bin: $PATH
5. After pressing ESC after entering the end: Enter Wq W save Q Exit can also input wq! Force Save exit
6. In/etc can be
Source Profile
Make a file effective or in another directory
Source/etc/profile
7. Then verify that Java-version appears
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)
The installation succeeds
Note: Problems that you may encounter ... I've met.
Tar decompression times wrong to say that the file decompression error should be the installation package into Linux when the incomplete re-upload a copy on the line
File effective source hint
-bash:exprot:command not found
It means there's a place where you have the wrong one. Or you can try it again or you're looking for a configuration, or you could just copy and paste.
Novice in doubt can only upload Linux can not download the answer is Yes
wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz? authparam=1461844139_04c9bfb7b00a644a89daabdc3dd56c0a
With wget can download but also need to find the address or in Windows to find the file after downloading more convenient (I think)
This article is from the "Faint blog" blog, please be sure to keep this source http://hong1yuan.blog.51cto.com/2274368/1850638
CentOS 7.0 Installation jdk-7u79-linux-x64.tar.gz Newbie recommendation