3

Well, I've made a fresh Ubuntu 11.10 install and I installed openJDK 7. It updated alternatives just after installing, so it was all good. Then, I compiled a source and executed it and it didn't worked, then I noticed that java was using the version 1.6, while the javac was 1.7. I thought I had installed it wrong, so I uninstalled it and installed it again. But now, it does not update alternatives automatically (it does it only for javaws). Is there a way to "restart" it so the apt-get does the update-alternatives by itself like the first time? Is it normal that it uses the java 1.6 instead of the java 1.7 when installing openJDK 7?

Thank you very much!

cgc512
  • 85

2 Answers2

2

To make the alternatives system decide what the "best" version is (based on the priority set during installation), run:

sudo update-alternatives --auto java
Lekensteyn
  • 174,277
2

I've purged openjdk after uninstalling, and I reinstalled it and worked the alternatives. Then I did an update-java-alternatives to set java to version 7 (I don't know why openjdk-7-jdk sets javac to version 7 and java to version 6 but whatever, now it works). Thanks for your help.

cgc512
  • 85