Virtual machine configuration jdk environment centos7

1. transfer files to centos7

View the virtual machine ip address ip addr

 

scp e:\jdk-12.0.2_linux-x64_bin.tar.gz [email protected]:/home

This command is host file transfer e jdk disk system to the home directory centos

 

2. Unzip the file jdk 

takes -xzvf JDK 12.0.2_linux-x64_bin.tar.gz 

centos in to the next home using this command to extract the file jdk

 

After successfully extract the extra file jdk-12.0.2 of

 

3. Set Environment Variables

Enter vi / etc / profile to configure the environment variables

Press Insert to enter edit mode move the cursor to the bottom

FIG enter the following export PATH = / home / jdk-12.0.2 / bin: $ / home / jdk-12.0.2 / jre / bin: $ PATH

After pressed the enter esc then enter: wq to save and exit

 

Input source / ect / profile updates to the environment variables to take effect

 

4. Test

Enter java java -version to see the version number

Enter javac to see the java information

 

Guess you like

Origin www.cnblogs.com/yyywh/p/11426283.html