Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1482  / 2 Years ago, mon, february 7, 2022, 8:37:17

I am getting different version of java when i run java -version and javac -version.
for java-version iam getting



java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.12.04.1)
OpenJDK Server VM (build 24.65-b04, mixed mode


javac -version
javac 1.6.0_33`


My environment variable path in ~/.profile is:

export PATH=${PATH}:/usr/lib/jvm/java-7-openjdk-i386/



Edit



which java: /usr/bin/java



which javac /usr/bin/javac


More From » 12.04

 Answers
4

From your edit, it looks like you have two instances of the openJDK installed. If you want them to match, you have two options:




  1. Uninstall the one you don't want. E.g. if you want open-jdk7 but not open-jdk6 do sudo apt-get remove --purge openjdk-6-*


  2. Update the alternatives for java using sudo update-alternatives --config java and pick the one you want. If you need to have both JDKs available, this is your best option as you can then just do that each time you need to switch



[#22016] Monday, February 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
restlerfin

Total Points: 347
Total Questions: 112
Total Answers: 108

Location: Ukraine
Member since Wed, Dec 16, 2020
3 Years ago
;