Posts Tagged ‘java config update-alternatives’


March 12th, 2009 2 comments

Having multiple jvm’s on your linux machine can be a pain in the ass. To select which jvm to use you can use the update-alternatives command. A small example of how to add a jvm to the alternatives here:

update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_11/bin/java 16011

This will add an entry for your jdk into the alternatives. The last number assigns the priority to this alternative. Which is the version and build number of the relase.

After adding you can use the following command to select the java version you want to use:

update-alternatives --config java

If you switch the java update-alternatives to auto it will automatically pick the java alternative with the highest priority.