Linux configure Java development environment

Linux configure Java development environment

1, the unloading system comes with OpenJDK Java and related documents

1-1: Use the administrator login server, type the command:

java -version

 

 We can see the system comes with OpenJDK information

1-2: Type the command:

rpm -qa | grep java

rpm Management Suite is a command, -qa indication inquiry mode Query All kits; grep indicates that the query file qualified string; java string representing the query contains the java

 

 

The above documents, noarch do not delete the file. The following delete command:

rpm -e --nodeps java-1.7.0-openjdk-1.7.0.221-2.6.18.0.el7_6.x86_64

rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.221-2.6.18.0.el7_6.x86_64

rpm -e --nodeps java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64

rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.212.b04-0.el7_6.x86_64

 

 

No such file or directory represented deleted successfully 

Download: https: //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2, get the real download path JDK1.8 (windows down)

Many online blog is Oracle's official website to get the download link, because the need to register an account and login, and download links as well as time constraints, too much trouble, so here I particularly recommend to you a mirror site, you can directly download link, is our Huawei greatly provided: https: //repo.huaweicloud.com/java/jdk/8u201-b09/ right Links -> copy link address that is to get real download path: https: //repo.huaweicloud.com/java/jdk /8u201-b09/jdk-8u201-linux-x64.tar.gz

 

 

2, CentOS use wget command to download JDK

wget https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz

After successful have the following interface:

 

 

3, extract the JDK

Type the command: ls, view files in the current directory

 

 

You can see, jdk-8u201-linux-x64.tar.gz has been downloaded to the current directory

unzip:

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

 

 

 

4, configure the environment variables

4-1 Editing global variables:

vim /etc/profile

vim is a text editing commands that edit global variables file profile

After entering the text edit mode 4-2, shift + G allows the cursor to the last line, and then press the button i, is inserted into the state;

The last line of text pasted at the contents:

#java enviroment

export JAVA_HOME=/root/jdk1.8.0_201

export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar

export PATH=$PATH:${JAVA_HOME}/bin

 

 Exit and save :( remember to press the esc key)

:wq!

 

 

4-3 source / etc / profile is just to make the environment settings to take effect

We're done!

The difference between the attached OpenJDK and Oracle JDK

General production line using Oracle's java, java environment because this configuration is more complete, more feature

1, different license agreement

OpenJDK using GPL V2 protocol release, and SUN JDK is used JRL release. Although both protocols are open source, but different in that the use of GPL V2 allows the use in commercial, research and JRL only allow individuals to use. OpenJDK does not contain Deployment (deployment) function: deployment features include: Browser Plugin, Java Web Start, as well as Java control panel, these features are not found in the OpenJDK.

2, OpenJDK source code is not complete

This is very easy to think, in the use of GPL OpenJDK protocol, SUN JDK source code as part of the problem of property rights can not be open to use OpenJDK, the most important part is optional SNMP component part of the JMX code. So these can not open source it made plug, for use when compiling OpenJDK, you can also choose not to use the plug. The Icedtea was incomplete portions of the source code developed these same functions (OpenJDK6), prompting more complete OpenJDK.

3, Open Jdk more streamlined

OpenJDK contains only the most streamlined JDK: OpenJDK does not contain other packages, such as Rhino Java DB JAXP ......, and can be separated packages are also separated as much as possible, but this is mostly free software, you can download added. This may result in no environmental yum install java jar command

4, version display

OpenJDK can not use the Java trademark, this is very easy to understand, install OpenJDK on the machine, enter "java -version" shows the OpenJDK, but if you are using Oracle installed java, shows the Java (TM)

Dry notes more attention to micro-channel public number: the old nine school

Guess you like

Origin www.cnblogs.com/ljxt/p/11612636.html