Install JDK 8 on Ubuntu 14.04
Install JDK 8 in Ubuntu 14.04.
Check whether jdk-related software is installed in the system. You can directly enter the java command:
# If the prompt is apt-get install <selected software package>, the system is not installed by default.
Www.bkjia.com @ bkjia :~ $ Java-version
Download the source code and decompress it:
Www.bkjia.com @ bkjia :~ $ Wget
Junluobj @ junluobj :~ $ Sudo mkdir/usr/lib/jvm
Www.bkjia.com @ bkjia :~ $ Tar zvxf jdk-8u20-linux-x64.tar.gz
Www.bkjia.com @ bkjia :~ $ Sudo mv jdk1.8.0 _ 20 // usr/lib/jvm/
Set JDK environment variables:
Www.bkjia.com @ bkjia :~ $ Sudo vim ~ /. Profile
# Set jdk env
Export JAVA_HOME =/usr/lib/jvm/jdk1.8.0 _ 20/
Export JRE_HOME =/usr/lib/jvm/jdk1.8.0 _ 20/jre
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH
# Save and exit. Enter the following command to make it take effect immediately.
Www.bkjia.com @ bkjia :~ $ Source ~ /. Profile
Verify JDK:
Www.bkjia.com @ bkjia :~ $ Java-version
Java version "1.8.0 _ 20"
Java (TM) SE Runtime Environment (build 1.8.0 _ 20-b26)
Java HotSpot (TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
If openjdk has been installed in the system, follow these steps to update it:
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.8.0 _ 20/bin/java 300
Update-alternatives: using/usr/lib/jvm/jdk1.8.0 _ 20/bin/java to provide/usr/bin/java (java) in auto mode
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.8.0 _ 20/bin/javac 300
Update-alternatives: using/usr/lib/jvm/jdk1.8.0 _ 20/bin/javac to provide/usr/bin/javac (javac) in auto mode
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- config java
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- config javac
Install JDK 7 In Ubuntu (with Clojure download)
Install JDK 12.04 in Ubuntu
CentOS6.3 install JDK and environment Configuration