Results 1 to 5 of 5

Thread: Complete latest Java installation guide (JRE + JDK)

  1. #1
    Join Date
    Jun 2007
    Location
    Belgium
    Beans
    Hidden!

    Lightbulb Complete latest Java installation guide (JRE + JDK)

    This thread is an up-to-date compilation of what's mentioned in this thread.

    Placeholders:

    TYPE: stands for i586 (32 bit) or x64 (64 bit)

    Notes:

    - I'll be using /home/user/Downloads as the default directory where the Java installation file is located and 6 update 21 ("6u21" and "1.6.0_21") as the Java version for this guide. Change these accordingly.

    - This guide requires you to download the .bin Java installation file from the Java website at http://www.java.com
    Java Runtime Environment installation

    Step 1: Browse to the directory where you want to install java and create it if it doesn't already exist, for example /opt/java

    Code:
    sudo mkdir /opt/java
    cd /opt/java
    Step 2: Now make sure the file is executable

    Code:
    chmod a+x /home/user/Downloads/jre-6u21-linux-TYPE.bin
    Step 3: Start the installation process

    Code:
    sudo sh /home/user/Downloads/jre-6u21-linux-TYPE.bin
    This displays the Java license agreement. Read through the agreement by pressing the Return button to display the next lines. At the end, enter yes to proceed with the installation.

    This should've created the "/opt/java/jre1.6.0_21" directory.

    Step 4: Now copy all the files to the main /opt/java directory

    Code:
    sudo cp -R /opt/java/jre1.6.0_21/* /opt/java
    Step 5: Lastly, delete the jre1.6.0_21 sub-folder

    Code:
    sudo rm -r /opt/java/jre1.6.0_21
    Step 6:
    To install the plugin in your web browser we need to create a symbolic link in the Mozilla plugins folder.

    32 bit JRE

    Code:
    sudo ln -s /opt/java/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
    64 bit JRE

    Code:
    sudo ln -s /opt/java/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins
    This should have created a symbolic link in the chosen Mozilla plugins directory. Restart Firefox and/or Opera (or any other Java supported web browser) and test it out at: http://www.java.com/en/download/inst...tect=jre&try=1

    Congratulations, now you've successfully installed Java on your system but hold on as we're not done yet.


    Last-and-optional-but-also-important step:
    To enable Java system-wide you'll have to add the directories to the PATH variable. Create a new shell file as the super user (for example java.sh):
    Code:
    sudo gedit
    and add the below lines to the file and save it in the "/etc/profile.d" directory.

    Code:
    PATH=$PATH:/opt/java/bin
    export PATH
    Next time you want to upgrade Java you just have to remove the existing Java directory
    Code:
    sudo rm -r /opt/java
    And repeat steps 1 to 5.


    Java Development Kit installation

    Step 1: Browse to the directory where you want to install java and create it if it doesn't already exist, for example /opt/java

    Code:
    sudo mkdir /opt/java
    cd /opt/java
    Step 2: Now make sure the file is executable

    Code:
    chmod a+x /home/user/Downloads/jdk-6u21-linux-TYPE.bin
    Step 3: Start the installation process

    Code:
    sudo sh /home/user/Downloads/jdk-6u21-linux-TYPE.bin
    This displays the Java (JDK) license agreement. Read through the agreement by pressing the Return button to display the next lines. At the end, enter yes to proceed with the installation.

    This should've created the "/opt/java/jdk1.6.0_21" directory.

    Step 4: Now copy all the files to the main /opt/java directory

    Code:
    sudo cp -R /opt/java/jdk1.6.0_21/* /opt/java
    Step 5: Lastly, delete the jdk1.6.0_21 sub-folder

    Code:
    sudo rm -r /opt/java/jdk1.6.0_21
    Step 6:
    To install the plugin in your web browser we need to create a symbolic link in the Mozilla plugins folder.

    32 bit JDK

    Code:
    sudo ln -s /opt/java/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
    64 bit JDK

    Code:
    sudo ln -s /opt/java/jre/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins
    This should have created a symbolic link in the chosen Mozilla plugins directory. Restart Firefox and/or Opera (or any other Java supported web browser) and test it out at: http://www.java.com/en/download/inst...tect=jre&try=1

    Congratulations, now you've successfully installed Java (JDK) on your system but hold on as we're not done yet.


    Last-and-optional-but-also-important step:
    To enable Java system-wide you'll have to add the directories to the PATH variable. Create a new shell file as the super user (for example java.sh):
    Code:
    sudo gedit
    and add the below lines to the file and save it in the "/etc/profile.d" directory.

    Code:
    PATH=$PATH:/opt/java/jre/bin
    export PATH
    Next time you want to upgrade Java (JDK) you just have to remove the existing Java directory
    Code:
    sudo rm -r /opt/java
    And repeat steps 1 to 5.
    Last edited by EarthMind; July 16th, 2010 at 08:03 AM.

  2. #2
    Join Date
    Apr 2010
    Location
    Hangar 18
    Beans
    89
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Complete latest Java installation guide (JRE + JDK)

    This isn't working for me... Just saying I don't have Java installed.

  3. #3
    Join Date
    Mar 2009
    Beans
    1

    Re: Complete latest Java installation guide (JRE + JDK)

    The JRE install doesn't work for me either. When I restart firefox and click the link I get "Verifying Java Version
    Oops! You don't have the recommended Java installed.
    Your Java version is Version 6 Update 20".
    I had to do the following after using the above JRE instructions. I have only tested this on a 32 bit system, but should work on 64 bit.

    1. Open a terminal window and copy and paste one line at a time...
    Code:
    sudo apt-get remove icedtea6-plugin sun-java6-jre
    sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/bin/java" 1
    sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/bin/java" 1
    sudo update-alternatives --set java /opt/java/bin/java

    2. Now check your java version...
    Code:
    java -version

    3. Now install your Firefox plugin. This step can be repeated for additional users. The "mkdir" and "rm" commands may give an error depending on what java plugins you have installed, but won't hurt. Copy and paste...
    Code:
    mkdir ~/.mozilla/plugins
    rm ~/.mozilla/plugins/libjavaplugin_oji.so
    rm ~/.mozilla/plugins/libnpjp2.so

    For 32 bit
    Code:
    ln -s /opt/java/lib/i386/libnpjp2.so ~/.mozilla/plugins/

    For 64 bit
    Code:
    ln -s /opt/java/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

    4. To check restart Firefox and type in the URL Bar...
    Code:
    about:plugins

    I now get...
    Java(TM) Plug-in 1.6.0_21

    Hope this helps someone.
    Last edited by TheSodicleOne; September 25th, 2010 at 09:51 AM.

  4. #4
    Join Date
    Jun 2007
    Location
    Belgium
    Beans
    Hidden!

    Re: Complete latest Java installation guide (JRE + JDK)

    That's probably because you didn't follow the steps exactly. Make sure to remove the previous java installation first and then install the new one by following the steps above. Make sure you don't remove any essential directories afterwards.

  5. #5
    Join Date
    Mar 2007
    Beans
    4

    Re: Complete latest Java installation guide (JRE + JDK)

    Firefox 3.6 and newer uses libnpjp2.so and not the old libjavaplugin_oji.so
    Last edited by schmoken; April 30th, 2012 at 02:43 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •