Reputation: 45
How to change java version to jdk1.7.0_80?
java -version java version "1.6.0_41" $JAVA_HOME
$JAVA_HOME: -bash: /usr/java/jdk1.7.0_80: is a directory
I have to update jdk version to 1.7.0_80 and i installed as well,but when i enter java -version,i am getting old version only
Upvotes: 1
Views: 1653
Reputation: 27
In CentOs: 1. vim /etc/profile , then edit '$JAVA_HOME'. 2. source /etc/profile, make the configuration take effect. 3. java -version, validate version.
Linux-like systems are similar. (If it does'n worked. Reboot.)
Upvotes: 0
Reputation: 898
First remove (puge) all installed JDK or JRE on your system
sudo apt-get purge openjdk-\* //(for exemple to remove open jdk on ubuntu)
For other steps you can follow steps in this link
Upvotes: 1
Reputation: 155
(1)Use following command to detect installed java version
sudo update-alternatives --config java
(2)Select selection number & Enter
(3)Re-Check java version with
java -version
Upvotes: 1