Customize Java in ubuntu

7 May 2008

Customize Java in ubuntu

Peace be upon you.

Sometimes ubuntu uses the java 1.6 as a default, wheres you need to use a another version of sun java like java 1.5. In this case you have to tell ubuntu which java you are looking forward to use.

Fellow the next steps in order solve your problem :-

  • Download the jdk version in which it will be used as default from http://java.sun.com/javase/downloads/index_jdk5.jsp (jdk 5 in our example here).
  • Open a Terminal window
  • Change your privileges to be root, write sudo -s.
  • Run sudo update-java-alternatives -l to see the current configuration and possibilities.
  • Run sudo update-java-alternatives -s XXXX to set the XXXX java version as default. For Sun Java 5 this would be sudo update-java-alternatives -s java-1.5.0-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

Any questions post them as a comment below. Have fun.

Entry Filed under: Linux. Tags: , , , , , , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

May 2008
S M T W T F S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts