When the Linux system is installed, it will bring its own openjdk1.xx.xx.
Uninstalling OPJDK
Download ORACLEJDK
Installing the JDK
Run validation
Some questions
Uninstalling OPJDK
- Use Java-version if the version is as shown, you need to uninstall
- Using Rpm-qa | The grep JDK can see which versions of the
- Uninstalling using the Yum-y remove JDK information
- OPENJDK Uninstall complete
Download ORACLEJDK
- Download the JDK's compressed package using the wget name
Oracle's JDK requires accept licence to download
wget wget–no-check-certificate–no-cookies–header "Cookie:oraclelicense=accept-securebackup-cookie" http// Download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
- Unzip the JDK
Use TAR-XZVF download link-c/usr/local
Unzip to the/usr/local folder
Installing the JDK
- Configuring the Environment
At the end of the/etc/profile folder, add
java_home=/usr/local/jdk1.8.0_131
Path=java_home/bin
Export PATH Java_home
Run validation
- Java-version Version Verification
- Compile validation
Javac Hello.java
- Run validation
Java Hello
Some questions
- Without OPENJDK, you can simply ignore the first step.
- Run validation could not find the main class
Most of the data in the configuration will be more than one classpath configuration, in fact, Classpath can not be configured, configuration after the Java command will appear to find the main class, delete the good.
Null
Installation of Oracle's JDK under Linux