Install JAVA environment variable under linux

The mounted linu64 bit operating system as a reference, the installation jdk1.8
a mounting preparation before
linux server a  
new java root user folder in / usr / local directory
two, JDK download
if linux server can be connected to the external network direct use wget command to download the oracle official website, if they can not access the internet you can download useful tool wear ftp server to / usr / local advance / java folder. Download wget command as follows:
wget --no-the Check-Certificate --no---header Cookies "Cookie: oraclelicense = the Accept-securebackup-the cookie" https://download.oracle.com/otn-pub/java/jdk/ 8u191-b12 / 2787e4a523244c269598db4e85c51e0c / jdk- 8u191-linux-x64.tar.gz
file extension after downloading can download with parameters, use the mv command to rename the file to file .tar.gz format; compression command will call solution unzip the package to the current directory. tar -xzvf jdk-8u191-linux- x64.tar.gz
Third, the environment variable configuration
to edit / etc / profile file
parameters added at the end of the following file
Export JAVA_HOME = / usr / local / the Java / jdk1.8.0_91
Export JRE_HOME = $ the JAVA_HOME} {/ JRE
Export the CLASSPATH =:. $ {the JAVA_HOME} / lib: $ {} the JRE_HOME / lib
export PATH=${JAVA_HOME}/bin:$PATH

Save and use the source / etc / profile command is to modify the parameters to take effect.
Execute java -version Displays the current version is java jdk installation instructions configured successfully.

来自 <https://www.cnblogs.com/zhangyyaf/p/10211945.html>

Guess you like

Origin www.cnblogs.com/torn/p/11683412.html