Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables
The following are notes about installing JDK 1.8.0 _ 25 on Ubuntu 14.04 and configuring environment variables.
1. source code package preparation:
First, download jdk and supervisor from the official website.
2. decompress the source code package.
Create a java folder in the/usr/local directory on the terminal and run the following command:
2. decompress the source code package.
Create a java folder in the/usr/local directory on the terminal and run the following command:
Sudo mkdir/usr/local/java
Copy the downloaded package to the java folder and run the following command:
Go to the directory where the jdk source code package is located
Cp jdk-8u25-linux-x64.tar.gz/usr/local/java
Go to the java directory and run the following command:
Cd/usr/local/java
Decompress the package and run the following command:
Sudo tar xvf jdk-8u25-linux-x64.tar.gz
Then you can delete the compressed package. command line:
Sudo rm jdk-8u25-linux-x64.tar.gz
3. Set jdk Environment Variables
The global setting method is used, which is an environment variable shared by all users.
$ Sudo gedit ~ /. Bashrc
As shown in:
Open and add at the end
Export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 25
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH
Remember, do not add spaces on both sides of the equal sign during the above process. Otherwise, "invalid identifiers" will appear, because unnecessary spaces cannot be identified during source/etc/profile, it is understood as part of the path.
Save the settings.
4. Check whether the installation is successful.
Enter the following command on the terminal:
Java-version
Check whether the installation is successful
The result is as follows:
Install JDK and configure environment variables in Ubuntu
Install JDK 7 In Ubuntu (with Clojure download)
Install JDK 12.04 in Ubuntu
CentOS6.3 install JDK and environment Configuration
Ubuntu14.04 64-bit JDK1.7 Installation