Wednesday, December 1, 2010

Choose default java version in Ubuntu

I got annoyed today, as I needed the sun jdk on my Ubuntu machine.
I had to goodle a while before finding how to change the default from open jdk to sun jdk

The how to is located here.

But I reproduce the text here:

Choosing the default Java to use

  • Open a Terminal window
  • Run sudo update-java-alternatives -l to see the current configuration and possibilities.
  • Run sudo update-java-alternatives -s XXXX to set the XXX java version as default. For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
  • Run java -version to ensure that the correct version is being called.
You can also use the following command to interactively make the change;
  • Open a Terminal window
  • Run sudo update-alternatives --config java
  • Follow the onscreen prompt
I still would prefer some gui to perform this. But it is a start.

No comments:

Post a Comment