Download and install the JDK below Linux, the main two-step, first, download the JDK in the appropriate location. Second, configure the environment variables.
First step, download the JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html download the appropriate version, Recommended download. tar.gz End of "jdk-8u51-linux-i586.tar.gz"
The second step, put in the appropriate position, is said to extract to the appropriate location. On the Linux command line, enter the Echo $JAVA _home, which will show a path, for example, my computer will now display,/usr/lib/jvm/jdk1.7.0_79 So, it is recommended to unzip to the appropriate location command: sudo tar zxvf Jdk-8u51-linux-i586.tar.gz-c/USR/LIB/JVM
The third step, configure the environment variables, in the Linux terminal, input sudo gedit/etc/profile, (with the sudo command in order to ensure that the configuration file can be changed, otherwise under the root user can.) Open the configuration file at the end of the add as follows:
Export java_home=/usr/lib/jvm/jdk1.8.0_51
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib
Then save the changes.
The fourth step, the Linux terminal input source/etc/profile This command is used to make the new configuration effective. This time again in the terminal input java-version should be able to see the version has changed.
Additional skills: If the above is not good, on the above basis, do the following:
Execute in the terminal sequentially
sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.8.0_51/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.8.0_51/bin/javac 300
sudo update-alternatives--install/usr/bin/jar Jar/usr/lib/jvm/jdk1.8.0_51/bin/jar 300
Re-execute
sudo update-alternatives--config java
This time there will be a variety of JDK version let you choose to enter its number, such as input: 3. (here 3 is the hypothesis, select the number corresponding to the/usr/bin/javac javac/usr/lib/jvm/jdk1.8.0_51.)
At this point, the terminal input java-version can see the version has been upgraded.
Thank you for reading.
Linux Install, update jdk