Build a Java Development Environment in Ubuntu Linux
Operating System: Linux x64/Ubuntu 14.04
Java JDK version: jdk-8u65-linux-x64.tar.gz
1. Go to the Oracle official website to download the latest version of Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html, and download it to the downloadsfolder.
2. Create a folder in the appropriate path to store Java JDK. In this example, create a new JVM sub-folder under the/opt directory. The operations are as follows:
Open Terminal (the last is T1) and enter:
Cd/opt # Go to the opt directory
Sudo mkdir jvm # create a jvm folder
Ls # display successfully created jvm folder
Cd jvm # enter the jvm folder
3. Copy the downloaded JDK compressed package to the jvm directory. The operations are as follows:
Create another Terminal window (T2) and enter:
Cd Downloads # enter the Downloads folder
Ls # display the downloaded JDK file,
Sudo cp jdk-8u65-linux-x64.tar.gz/opt/jvm # copy the file to the newly created jvm folder (here change the file name to your corresponding JDK version, later the same)
Sudo rm jdk-8u65-linux-x64.tar.gz # Delete the installation package in the local directory (optional)
4. Unzip and install Java JDK and configure environment variables. The operations are as follows:
Return to the first Terminal (T1) and enter:
Ls # display the copied JDK installation package
Sudo tar-zxvf jdk-8u65-linux-x64.tar.gz # unzip the installation package
Ls # display the decompressed JDK folder and the original installation package
Sudo rm jdk-8u65-linux-x64.tar.gz # delete original installation package
Sudo gedit/etc/profile # Open the profile file under the etc directory
5. configure global environment variables. The operations are as follows:
Add the JDK installation path at the end of the opened profile document (Please confirm carefully ):
# Set java environment
Export JAVA_HOME =/opt/jvm/jdk1.8.0 _ 65
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =.: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH
6. Save and close the document. (Note: You can also run the vim command to edit etc/profile, open the command: sudo vim/etc/profile, press <Insert> to enter the edit mode, and <Esc> to exit the edit mode, press ":" and then enter "wq! "Save and exit; enter" q! "Do not save and Exit)
7. Enable configuration and verify. In Terminal, enter:
Java-version
8. If the display effect is similar to the following, the operation is successful:
Java version "1.8.0 _ 65"
Java (TM) SE Runtime Environment (build 1.8.0 _ 65-b17)
Java HotSpot (TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Build a Java Development Environment in Ubuntu 14.04
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