Difference between revisions of "Howto install proprietary Java from Oracle"
(→Checking Java installation) |
|||
Line 5: | Line 5: | ||
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/ | 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 . | + | You can '''download''' the official Oracle Java RPMs from http://www.oracle.com/technetwork/java/javase/downloads/index.html . You can also use tar.gz packages from same place. |
{{Note|If you can install appropriate RPM package ({{file|jdk-7u6-linux-i586.rpm}}, {{file|jdk-7u6-linux-x64.rpm}}, {{file|jre-7u6-linux-i586.rpm}} or {{file|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.}} | {{Note|If you can install appropriate RPM package ({{file|jdk-7u6-linux-i586.rpm}}, {{file|jdk-7u6-linux-x64.rpm}}, {{file|jre-7u6-linux-i586.rpm}} or {{file|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.}} | ||
+ | |||
+ | If you use RPMs, be prepared that you will get error like this after install | ||
+ | installing jre-7u6-linux-x64.rpm | ||
+ | Preparing... | ||
+ | ##################################################################################################### | ||
+ | 1/1: jre | ||
+ | ##################################################################################################### | ||
+ | Unpacking JAR files... | ||
+ | rt.jar... | ||
+ | Error: Could not open input file: /usr/java/jre1.7.0_06/lib/rt.pack | ||
+ | jsse.jar... | ||
+ | Error: Could not open input file: /usr/java/jre1.7.0_06/lib/jsse.pack | ||
+ | charsets.jar... | ||
+ | Error: Could not open input file: /usr/java/jre1.7.0_06/lib/charsets.pack | ||
+ | localedata.jar... | ||
+ | Error: Could not open input file: /usr/java/jre1.7.0_06/lib/ext/localedata.pack | ||
+ | |||
+ | Just ignore that message, and skip steps 4 to 6. | ||
+ | |||
+ | If you use tar.gz packages, just skip step R4 (RPM installation). | ||
+ | |||
+ | Everything else is same in both cases. | ||
==JRE 7u6 64bit== | ==JRE 7u6 64bit== |
Revision as of 13:29, 27 August 2012
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 . You can also use tar.gz packages from same place.
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.
If you use RPMs, be prepared that you will get error like this after install
installing jre-7u6-linux-x64.rpm Preparing... ##################################################################################################### 1/1: jre ##################################################################################################### Unpacking JAR files... rt.jar... Error: Could not open input file: /usr/java/jre1.7.0_06/lib/rt.pack jsse.jar... Error: Could not open input file: /usr/java/jre1.7.0_06/lib/jsse.pack charsets.jar... Error: Could not open input file: /usr/java/jre1.7.0_06/lib/charsets.pack localedata.jar... Error: Could not open input file: /usr/java/jre1.7.0_06/lib/ext/localedata.pack
Just ignore that message, and skip steps 4 to 6.
If you use tar.gz packages, just skip step R4 (RPM installation).
Everything else is same in both cases.
Contents
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"
Checking Java installation
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.