Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Sun Java Jre 6 from the source. According to the icon under the Applications menu, it is called "Sun Java 6". Yet, the java -version command yields:

java version "1.5.0" gij (GNU libgcj) version 4.5.4

First off, why is Java not 1.6? Also, what is gij?

share|improve this question
Perhaps provide some details on how you installed Java? For reference, gij is the interpreter associated with the gcj compiler. – James Henstridge Mar 17 '12 at 0:55
What exactly is gcj? I installed it by downloading a .tar.gz of Java 6 and installed it from there. – Ryan McClure Mar 17 '12 at 1:49
GCJ is a Java compiler that is part of the GCC tool chain. – James Henstridge Mar 17 '12 at 2:13
up vote 2 down vote accepted

I figured it out. I ran

 sudo update-alternatives --config java 

and found that my java was not selected. I selected it and now java -version returns 1.6.

share|improve this answer

Just follow these simple steps:

sudo add-apt-repository "deb lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin 

Ubuntu doesn't ship Sun Java because it's not totally free.

There's more information here. I suggest you read it.

share|improve this answer
This isn't particularly good advice given… – James Henstridge Mar 17 '12 at 2:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.