Jdk installation and configuration environment (two ways) Linux system

Jdk installation and configuration environment (two ways) Linux system

Here are jdk installation and configuration environment both linux environment
installed jdk windows system and environment configuration, I believe we will be here do not go into details, this is mainly talk about environment jdk installation and configuration under linux.

  1. The first part of the installation fool, a key can be installed (yum installed);
  2. The second manual installation, Oracle to make their own official website to download the version of jdk, then unpack and configure the environment, the whole process is actually very simple.

A, yum install a key to
this approach is simple and crude, just as Galen lost skills. Ado, just start the operation.

1. First execute the following command to view the version that can be installed jdk:

yum -y list java*

  

  • 1

After the successful execution can see the following interface:
Here Insert Picture Description

2. Select the version of jdk they need to install, such as where to install 1.8, execute the following command:

yum install -y java-1.8.0-openjdk-devel.x86_64

  

  • 1

Wait for the installation to complete.

3. After installation is complete, view the installation of jdk version, enter the following command:

java -version

  

  • 1

Here you can see the information they jdk version installed.
If you're curious about this automatically install the jdk installed gone, in fact, you can find them in the usr / lib / jvm.
ok, complete!

Second, the manual installation

If you think a key to install yum is not good, in fact, can be manually installed, manually install personal recommendations or better and can be installed to the directory you want to install, which helps improve your experience. ok, began to take over manual installation!

1. Oracle's official website to download the jdk version needs to be installed, I used here is jdk-8u181-linux-x64.tar.gz
the compressed package into / usr / local under 2. / jdk directory, the directory jdk need to manually created, also known as java, free to take their own name (see name known in Italy), then unzip the archive, enter the following command:

tar zxvf jdk-8u181-linux-x64.tar.gz

  

  • 1

Upon successful decompression, as shown below:
Here Insert Picture Description
3. Next time to configure the environment variables, Enter the following configuration:

vim /etc/profile

  

  • 1

Enter the complete and return, in the end of the file add the following information:

export JAVA_HOME=/usr/local/jdk/jdk1.8.0_181
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/ 
export PATH=$PATH:$JAVA_HOME/bin

  

  • 1
  • 2
  • 3
  • 4

Note: JAVA_HOME first row = / usr / local / jdk / jdk1.8.0_181 the right of the equal sign here is their actual decompression jdk directory. If not you need to change the directory to their actual catalog, the other unchanged.
The actual situation as shown below:
Here Insert Picture Description
4. after editing, save and exit, and then enter the command, the refresh environment configuration to take effect:

source /etc/profile

  

  • 1

5. Check jdk is installed successfully, you can enter the command java -version.
Here Insert Picture Description
6. At this point, the manual installation is complete -

 
 
 
 
 

Guess you like

Origin www.cnblogs.com/domefy/p/11877463.html