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'm having a small problem. I've been trying to work Minecraft into working using Wine. Over the past few hours, I've been working with Java over and over (long story, I'll keep it relevant) and have finally come to an answer. I need to install Oracle Java, or Sun-JRE as more commonly known. I found this answer http://askubuntu.com/a/56119 and followed the instructions. I changed the file name where need-be in the commands for the newer version, placing the extracted file into /usr/lib/jvm but when I type this command:

sudo update-alternatives --config java

I am met with this:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java        1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java        1061      manual mode
* 2            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode

Press enter to keep the current choice[*], or type selection number:

This confuses me, as I followed the steps in the answer linked previously by copy/pasting and editing for the file name. The name of the file I used is Linux x86 32.25 MB jre-7u2-linux-i586.tar.gz. The ls -ld command returned the following:

ls -ld /usr/lib/jvm/*
lrwxrwxrwx 1 root   root    14 2011-09-27 12:25 /usr/lib/jvm/default-java -> java-6-openjdk
lrwxrwxrwx 1 root   root    14 2011-10-22 01:14 /usr/lib/jvm/java-1.6.0-openjdk -> java-6-openjdk
lrwxrwxrwx 1 root   root    19 2011-10-21 19:24 /usr/lib/jvm/java-1.7.0-openjdk-i386 -> java-7-openjdk-i386
drwxr-xr-x 5 root   root   120 2011-12-16 02:35 /usr/lib/jvm/java-6-openjdk
drwxr-xr-x 3 root   root    60 2011-12-16 02:35 /usr/lib/jvm/java-7-openjdk-common
drwxr-xr-x 5 root   root   120 2011-12-16 02:35 /usr/lib/jvm/java-7-openjdk-i386
drwx------ 6 ubuntu ubuntu 240 2011-11-17 21:39 /usr/lib/jvm/jre1.7.0_02

Any help is appreciated, and thanks in advance.

share|improve this question
    
please add the output from ls -ld /usr/lib/jvm. Which JRE filename did you download from (oracle.com/technetwork/java/javase/downloads/…)... –  fossfreedom Dec 16 '11 at 11:00
    
/usr/lib/jvm$ ls -ld drwxr-xr-x 6 root root 220 2011-12-16 03:53 . and I used the Linux x86 version, second option. –  Estel Dec 16 '11 at 15:42
    
... try ls -ld /usr/lib/jvm/* - add this back into your question, not into a comment. Also add the JRE filename info backinto you question. –  fossfreedom Dec 16 '11 at 15:44

1 Answer 1

up vote 1 down vote accepted

First of all, please add the correct permissions to the folder...

sudo chmod -R rwxr-xr-x /usr/lib/jvm/jre1.7.0_02

Next add JRE to the Java Alternatives

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_02/bin/java 3;

And finaly, run the command:

sudo update-alternatives --config java
share|improve this answer
    
PERMISSIONS! DOH! Thank you very much! Also-- Your chmod command was formatted incorrectly. I haven't used it in a while, so I skipped using the textual layout for permission definition. I used sudo chmod -R 755 /usr/lib/jvm/jre1.7.0_02 instead. Again, thanks! –  Estel Dec 17 '11 at 14:49
    
Ok, that's good to know you solved your problem. –  edgerch Dec 19 '11 at 21:09

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.