Procedure when you want to change the java version on centOS. It's a memo for myself because I check it every time.
What is written is almost the same as the following article. I was allowed to reference. Thank you very much. https://qiita.com/Sa2/items/8ba501294df745be8c78 https://qiita.com/hajimeni/items/67d9e9b0d169bf68d1c9
Environment implemented this time ・ CentOS release 6.9 (Final) Java I want to drop this time ・ Java1.8.x
Check the installed java version.
java -version
Remove the installed java.
yum remove java-1.6.0-openjdk
#### **`yum remove java-1.7.0-openjdk`**
If you delete it
java -version
bash: /usr/bin/java:There is no such file or directory
Will be.
Click the download button for the version you want from the following page http://www.oracle.com/technetwork/java/javase/downloads/index.html
Check the radio button of Accept License Agreement, Right-click the file you want to drop → copy the link address
wget.
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" <Copyed address>
Installation
rpm -ivh xxx.rpm
Verification
```java -version```
#### **`java version "1.8.0_151"`**
...```
Recommended Posts