2012-07-20

Ubuntu + OracleJava7 [EN]

If you have any problem with java7 provided by Ubuntu (o any other version), you can install Oracle version (or any other), with the following instructions:

  1. Get the current version in order to verify it has changed.

    java -version

    It returns something like this:

    java version "1.7.0_03"
    OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
    OpenJDK Server VM (build 22.0-b10, mixed mode)
    

  2. Unzip de file

    tar -xvf jre-7u5-linux-i586.tar.gz

  3. Move the resulting directory to a path reachable by other users, I like /opt

    sudo mv jre1.7.0_05 /opt

  4. Add this version to the list of available alternatives

    sudo update-alternatives --install /usr/bin/java java /opt/jre1.7.0_05/bin/java 0

  5. Select this version

    sudo update-alternatives --config java

    I returns something like this:

    There are 3 choices for the alternative java (providing /usr/bin/java).
    
      Selection    Path                                           Priority   Status
    ------------------------------------------------------------
    * 0            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      auto mode
      1            /opt/jre1.7.0_05/bin/java                       0         manual mode
    
    Press enter to keep the current choice[*], or type selection number:
    

    Select the appropiate option, in this case option 1

  6. Verify the current version has changed.

    java -version

    It returns something like this:

    java version "1.7.0_05"
    Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
    Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)
    

If any problems with javaws, repeat steps above replacing java by javaws

Bibliography Instalar Oracle Java 7 en Ubuntu 12.04

No hay comentarios: