Howto install proprietary Java from Oracle

From Rosalab Wiki
Revision as of 18:42, 23 August 2012 by Juliette (Talk | contribs)

Jump to: navigation, search
Many thanks to user viking who wrote this howto :)

Due to the fact that package get-jre7-oracle was removed from ABF because of Oracle licensing policy ROSA users now have to download and install Oracle Java packages from the official Oracle site.

This HOWTO is based on original RH tutorial awailble on this link: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/

You can download the official Oracle Java RPMs from http://www.oracle.com/technetwork/java/javase/downloads/index.html .

Idea.png
Note
If you can install appropriate RPM package (jdk-7u6-linux-i586.rpm, jdk-7u6-linux-x64.rpm, jre-7u6-linux-i586.rpm or jre-7u6-linux-x64.rpm), you can skip steps from 1 to 6, but steps from 7 to the end have to be done even in that case.

JRE 7u6 64bit

1. Download jre-7u6-linux-x64.tar.gz from

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.html

2. Type

su -

and provide root passwrod

3. Go to /home/<your username>/Downloads or whatever folder you've downloaded the package to

4. Remove JRE 7u6 and links named latest and default

rm -rf /usr/java/jre1.7.0_06
rm -f /usr/java/latest
rm -f /usr/java/default 

5. Extract package to appropriate folder

tar -xzf jre-7u6-linux-x64.tar.gz -C /usr/java/ --no-same-owner

6. Make symbolic links for latest and default

ln -sf ./jre1.7.0_06 /usr/java/latest
ln -sf ./latest /usr/java/default

7. Install Java

alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000

8. Install JavaWS

alternatives --install /usr/bin/javaws javaws /usr/java/latest/bin/javaws 20000

9. Install Browser (Mozilla) Plugin

alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/lib/amd64/libnpjp2.so 20000

10. Export JAVA_HOME

export JAVA_HOME="/usr/java/latest"

JRE 7u6 32bit

1. Download jre-7u6-linux-i586.tar.gz from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.html

2. Type

su -

and provide root passwrod 3. Go to /home/<your username>/Downloads

4. Remove JRE 7u6 and links named latest and default

rm -rf /usr/java/jre1.7.0_06
rm -f /usr/java/latest
rm -f /usr/java/default 

5. Extract package to appropriate folder

tar -xzf jre-7u6-linux-i586.tar.gz -C /usr/java/ --no-same-owner

6. Make symbolic links for latest and default

ln -sf ./jre1.7.0_06 /usr/java/latest
ln -sf ./latest /usr/java/default

7. Install Java

alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000

8. Install JavaWS

alternatives --install /usr/bin/javaws javaws /usr/java/latest/bin/javaws 20000

9. Install Browser (Mozilla) Plugin

alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/lib/i386/libnpjp2.so 20000

10. Export JAVA_HOME

export JAVA_HOME="/usr/java/latest"

If you need JDK instead of JRE, then you have to do something very similar.

JDK 7u6 64bit

1. Download jdk-7u6-linux-x64.tar.gz from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html

2. Type

su -

and provide root passwrod

3. Go to /home/<your username>/Downloads or whatever folder you've downloaded the package to

4. Remove JRE 7u6 and links named latest and default

rm -rf /usr/java/jdk1.7.0_06
rm -f /usr/java/latest
rm -f /usr/java/default 

5. Extract package to appropriate folder

tar -xzf jdk-7u6-linux-x64.tar.gz -C /usr/java/ --no-same-owner

6. Make symbolic links for latest and default

ln -sf ./jdk1.7.0_06 /usr/java/latest
ln -sf ./latest /usr/java/default

7. Install Java

alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

8. Install JavaWS

alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

9. Install Browser (Mozilla) Plugin

alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 20000

10. Install javac and jar

alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

11. Export JAVA_HOME

export JAVA_HOME="/usr/java/latest"

JDK 7u6 32bit

1. Download jdk-7u6-linux-i586.tar.gz from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html

2. Type

su -

and provide root passwrod

3. Go to /home/<your username>/Downloads or whatever folder you've downloaded the package to

4. Remove JRE 7u6 and links named latest and default

rm -rf /usr/java/jdk1.7.0_06
rm -f /usr/java/latest
rm -f /usr/java/default 

5. Extract package to appropriate folder

tar -xzf jdk-7u6-linux-i586.tar.gz -C /usr/java/ --no-same-owner

6. Make symbolic links for latest and default

ln -sf ./jdk1.7.0_06 /usr/java/latest
ln -sf ./latest /usr/java/default

7. Install Java

alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

8. Install JavaWS

alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

9. Install Browser (Mozilla) Plugin

alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 20000

10. Install javac and jar

alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

11. Export JAVA_HOME

export JAVA_HOME="/usr/java/latest"

You can check current java, javac, javaws and libjavaplugin.so versions like this:

java -version
javaws

And if you installed JDK

javac -version

Open http://www.java.com/en/download/installed.jsp in your browser.