0

I installed openjdk-7-jdk, "javac" was version 7 but "java" was still version 1.6, any way around this? No updates are available.

2 Answers 2

1

It's because the javac file in /usr/bin is still linking to your previous jdk. So you have to using update-alternative to configure it.

1
  • 1
    sudo update-alternatives --config java Commented Dec 23, 2011 at 15:52
0

You can use

$ sudo update-java-alternatives -l

to get the list of JVMs and then use

$ sudo update-java-alternatives -s NAME

to set the one you want. It may warn about some missing links, in which case you'll need to install the missing package and run update-java-alternatives again.

1
  • When I run sudo update-java-alternatives -s java-7-oracle, it gives me : " update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so. update-alternatives: error: alternative /usr/lib/jvm/java-7-oracle/jre/bin/jexec for jexec not registered, not setting. update-alternatives: error: alternative /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so for mozilla-javaplugin.so not registered, not setting. update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so. " What is the matter? I use ubuntu12.04 amd64. Commented Jan 18, 2013 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .