Easy way to set up java version to use in Ubuntu

Repost from here: https://blogs.oracle.com/pc/entry/easy_way_to_set_your

First list all java version available
ls -al /usr/lib/jvm

Pay attention to the .jinfo file, choose one of those you want, and set up:
sudo update-java-laternatives -s java-1.7.0-openjdk-i386

Done! Really simple!

Update: From here http://askubuntu.com/questions/141791/is-there-a-way-to-update-all-java-related-alternatives
NOTE: The command above threw the following errors
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
This is because the openjdk plugin is not installed by default. To fix run sudo apt-get install icedtea-7-plugin and rerun update-java-alternatives.

Easy way to set up java version to use in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s