Tutorial on installing and configuring the Java environment in Ubuntu16.04, ubuntu16.04java
1. Download jdk.
2. Verify that java is installed. Use the java-version Command, as shown in:
3. Create a jdk-8 directory in the usr directory, as shown in:
4. configure system environment variables, edit the/etc/profile file, and add the following information at the end of the file:
Export JAVA_HOME =/usr/jdk1.8.0 _ 101
Export JRE_HOME = JAVAHOME/jreexportCLASSPATH =.: "role =" presentation "> JAVAHOME/jreexportCLASSPATH =.: JAVAHOME/jreexportCLASSPATH =.: CLASSPATH: JAVAHOME/lib: "role =" presentation "> JAVAHOME/lib: JRE_HOME/lib
Export PATH = PATH: "role =" presentation "> PATH: JAVA_HOME/bin: $ JRE_HOME/bin
Export JAVA_HOME =/usr/jdk-8 is the main directory for configuring jdk
Export JRE_HOME = $ JAVA_HOME/jre is the directory for jre Configuration
Export CLASSPATH =.: CLASSPATH: "role =" presentation "> CLASSPATH: JAVA_HOME/lib: $ JRE_HOME/lib is the configured CLASSPATH directory.
Export PATH = PATH: "role =" presentation "> PATH: JAVA_HOME/bin: $ JRE_HOME/bin: add the jdk executable file directory to the system environment directory.
As shown in:
6. Use the source/etc/profile command to make the configuration take effect, as shown in:
7. Use the java-version command again for verification, as shown in: