Debian: Ubuntu 11.04 Setting Up JAVA - 'update-alternatives'
Posted by email
I was working on setting JAVA environment for my Ubuntu 11.04 box
Searched a little and found nothing much on how to update default Open java path to sun java.
I downloaded sun package and unzipped in the /opt/java/ directory and set the JAVA_HOME and PATH variables in .bash_profile and .bash_rc.
But still I was not getting the sun java.
Then I check in ubuntu 11 we need to set the update-alternative as well.
Here is how you do it.
Let say I have the java package in the below directory.
/opt/java/jdk1.6/
Follow the below steps.
- Register the java command - here 500 is the priority
- Update and set new java path
- Finally Configure the default java command
]$ sudo update-alternatives --config java
Hope it helps someone.



