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):
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):
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.
Bookmarks