How can I check which Java I have installed on Linux?

Last edited on

On Linux you should make sure that you are using Oracle Java (or compatible) and that it is in your PATH.

You are not running Oracle's Java if your log contains the following:

"java.fullversion=GNU libgcj 4.1.1 20070105 (Red Hat 4.1.1-52)"

Some Linux distributions install GCJ's Java as the default "Java". However, GCJ does not have complete Java compatibility. Please switch to an Oracle or IBM Java Runtime Environment on your Linux installation (or configure your Eclipse to use an Oracle/IBM JRE installation on that computer) so that we can rule out any compatibility-related problems right from the start.

You can find Sun's instructions on downloading Java here

After you have installed Java, on the command line, type

$ java -version

to see which version of Java you have, and then type

$ which java

to check which version of Java you are actually using.