Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have recently upgraded to Ubuntu 11.10 and was noticing that Java was not working on a few websites and ran a check:

keith@KD-PB:~$ java -version

java version "1.5.0"

gij (GNU libgcj) version 4.6.1

Copyright (C) 2007 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So I uninstalled my Java (OpenJDK 1.6.0 according to Ubuntu Software Centre) and reinstalled it and all the dependicies. So tried checking I had the right Java package installed;

keith@KD-PB:~$ sudo update-alternatives --config java

There is only one alternative in link group java: /usr/bin/gij-4.6

Nothing to configure.

So now I am scratching my head and not sure what is wrong. I have installed Oracle's JRE 6 and it works straight away, so what could be wrong with the OpenJDK?

Thanks

UPDATE - From some suggestions I inputted the following and think there is a problem with where /etc/alternatives/java is pointing;

keith@KD-PB:~$ ls -l which java lrwxrwxrwx 1 root root 22 2011-10-17 06:34 /usr/bin/java -> /etc/alternatives/java keith@KD-PB:~$ ls -l /etc/alternatives/java lrwxrwxrwx 1 root root 16 2011-10-17 06:34 /etc/alternatives/java -> /usr/bin/gij-4.6

keith@KD-PB:~$ dpkg -S /usr/lib/jvm/java-6-openjdk/jre/bin/java openjdk-6-jre-headless: /usr/lib/jvm/java-6-openjdk/jre/bin/java

share|improve this question
    
How did you install the Oracle JRE?. –  Javier Rivera Oct 17 '11 at 8:48
    
I installed Oracle's Java via this PPA launchpad.net/~ferramroberto/+archive/java I try to avoid adding PPA's that I am not 100% about. I am still trying to get OpenJDK to work, but keep getting the same message. –  Victor9098 Oct 23 '11 at 19:17
add comment

2 Answers 2

Yeah... It's weird that the OpenJDK is not working... I had several problems with it and Eclipse, so I had to put Java from Oracle. It works excellent. My suggest: don't install OpenJDK.

share|improve this answer
add comment
up vote 0 down vote accepted

I tried uninstalling and reinstalling the java installations several times but nothing changed, it would only detect the gij java application, or none at all when that was removed. So the following workaround did it for me.

I added the the Webupd8 PPA to my list of repo's and from their I installedhe application called 'update-java'. After installing I ran it update-java from the terminal, it went looking for the java I had installed, found it and then in a GUI asked me to pick which one to set as standard. After doing this I ran java-version from the terminal to confirm.

I can confirm it is working again and seems to be set up correctly.

share|improve this answer
add comment

Your Answer

 
discard

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.