Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers 2

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.

share|improve this answer
1  
sudo update-alternatives --config java –  medigeek Dec 23 '11 at 15:52
add comment

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.

share|improve this answer
    
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. –  waterloo2005 Jan 18 '13 at 8:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.