Java administration tips for Ubuntu

If you are an Ubuntu user and you use Java you would benefit from some cool tips I’ve found while browsing the Ubuntu forums of late.

By default Ubuntu comes with a version of Java (jgc) that isn’t Sun’s.  This isn’t a problem unless you are perhaps developing Java applications, in that case you might want to install the Sun JDK.  This is done easily via the package manager, just search for sun jdk ad pick your version.

Unfortunately despite installing Sun’s jdk the Java system may not be fully utilising it.

java -version in a terminal session will show you the current version in use, and this should be the one you installed from the package manager.

Now try sudo update-alternatives –config java in the terminal.
This should produce a list of installed Java versions and there will be a * by the default one in use.  Pick the number that corresponds to the version you want to use (or accept the current default and that will now become the default Java version for Ubuntu.

This can be handy if you want to check your app in different versions of Java or develop to a specific version, or even switch to a different version to troubleshoot environment issues you suspect are Java related.

Technorati Tags: ,

Powered by ScribeFire.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: