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've been having an issue with Java since I installed Ubuntu and it has been the main reason I have stopped playing certain Java-based games such as Minecraft. You see, although I've downloaded OpenJDK 6 from the Software Center, Ubuntu refuses to recognize that I do in fact have it installed. When I type java -version into the terminal, the following pops up:

The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.6-jre-headless
 * gcj-4.7-jre-headless
 * openjdk-7-jre-headless
 * openjdk-6-jre-headless
Try: sudo apt-get install <selected package>

Giving it the benefit of the doubt, I tried installing these as well. Unfortunately, java -version continues to present me this same exact message every time. Also, just to make sure the terminal wasn't drunk, I checked Minecraft.jar>Properties>Open With and OpenJDK 6 was, unsurprisingly, not available from the list.

Edit: Here are the results of dpkg -l | grep jdk:

ii  openjdk-6-jre:i386                        6b27-1.12.6-1ubuntu0.12.10.2              i386         OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-6-jre-headless:i386               6b27-1.12.6-1ubuntu0.12.10.2              i386         OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-6-jre-lib                         6b27-1.12.6-1ubuntu0.12.10.2              all          OpenJDK Java runtime (architecture independent libraries)
ii  openjdk-7-jre:i386                        7u21-2.3.9-0ubuntu0.12.10.1               i386         OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:i386               7u21-2.3.9-0ubuntu0.12.10.1               i386         OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                         7u21-2.3.9-0ubuntu0.12.10.1               all          OpenJDK Java runtime (architecture independent libraries)
share|improve this question
    
Please, edit your question to include the output of dpkg -l | grep jdk. –  Eric Carvalho Jul 24 '13 at 15:56

2 Answers 2

Maybe something went wrong with the installation and some links are set in a wrong way. Try uninstalling Java:

sudo apt-get purge icedtea-* openjdk-*

Restart your computer and install it again.

Maybe you also want to try out Sun-Java instead of openJDK. Follow this thread:

How can I install Sun/Oracle's proprietary Java 6/7 JRE or JDK?

share|improve this answer

Personally, I prefer using the Oracle JDK over the default openJDK (IcedTea). Just download the .tar or .bin and extract it to /opt/java/JDK1.7.0_25 (or whatever). Then, use "update-alternatives" to add the links (into your PATH) for that location.

share|improve this answer
    
I tried this as you suggested, however, Oracle JDK 7 still fails to show up on the "Open With" list just as OpenJDK 6 had. Any thoughts? Regardless, thank you for at least attempting to help. –  Uehara Jul 24 '13 at 20:53

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.