How to switch between different Java (JVM) in Ubuntu and Debian GNU Linux

advertisement logo

 

Sometimes its hard to avoid installing multiple Java Virtual Machines (JVM) on your computer because it has something to do with application compatibility or software development purposes.

This creates an annoyance when you just want to run one of the JVM instead of another for a specific task, then having to switch to another JVM for other tasks.

Here's an easy way to setup a default JVM (Java interpreter and javac) and switch between several JVM in Ubuntu / Debian based distribution.

From the console execute

CODE:
  1. sudo update-alternatives --config java

Then you'll be presented with this menu,

jvmtn.jpg

Select the Java distribution which best suits you and press enter. You're done. You can always change the default JVM for your Ubuntu/Debian distribution by repeating this steps.

Tags: , , , , , , , ,

Bookmark this article These icons link to social bookmarking sites where readers can share and discover new web pages.
  • digg
  • YahooMyWeb
  • NewsVine
  • Netvouz
  • Reddit
  • Spurl
  • Furl
  • del.icio.us
  • StumbleUpon
  • Technorati
  • TwitThis

Keep updated with this website! : Subscribe to your email

Recommended Reading

4 smashing comments for this post.

  1. Zootropo Said:

    In fact that would only change the interpreter, not the compiler, creating a symlink from ¿/etc/alternatives/java? to the executable you selected.

    For the compiler you’d have to write:
    sudo update-alternatives –config javac

  2. mypapit Said:

    yes, true.. thanks for adding the suggestion :)

  3. Gimfred Said:

    Thank you! I am doing my first programming course and everything is windows orientated. ARGH! I have be having trouble practicing a home because they wanted me to use Textpad etc and it doesn’t seem to work in Wine. Now, I’m on my way! (yes, my program worked!

  4. Jan Berger Said:

    thank you, this saved me a lot of work :)

Leave a Comment

Subscribe by email

Enter your Email