Главная » programming » Java 7, wget java jdk jre installing in Linux

Java 7, wget java jdk jre installing in Linux



wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-i586.tar.gz"
curl -b gpw_e24=http%3A%2F%2Fwww.oracle.com -O -L http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jre-7u17-linux-x64.tar.gz‌​
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-x64.rpm
wget "http://javadl.sun.com/webapps/download/AutoDL?BundleId=68234" -O java.tar.gz
sudo wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.tar.gz"


wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.tar.gz



You can have both as I have on my Debian Wheezy, the open-source version of JAVA that is known as Icedtea and the one from Oracle that I’m going to install now.

The issue for me was that the icedtea-plugin was not playing nice with DELL’s DRAC Console and for my wife was that she was unable to watch some java applet played vids online.

Ok, nonetheless, let’s first make sure the system is up-to-date

apt-get update
apt-get upgrade
apt-get dist-upgrade

I’m using 64bit [amd64] version of Debian 7, so if you’re not, make sure you tune the commands accordingly. Also, the URLs may change, so make sure you verify that aswell . Always get the latest version from here

Download JAVA 7 from Oracle’s website using wget

wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz" \
-O /tmp/jdk-7-linux-x64.tar.gz

for 32 bit system you may use

wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-i586.tar.gz" \
-O /tmp/jdk-7-linux-i586.tar.gz

Unpack the downloaded JAVA 7 archive in /opt

mkdir /opt/java-oracle
tar -zxf /tmp/jdk-7-linux-x64.tar.gz -C /opt/java-oracle

for 32 bit system use this instead

tar -zxf /tmp/jdk-7-linux-i586.tar.gz -C /opt/java-oracle

Set-up Oracle’s JAVA 7 to be used on the system by using higher priority with update-alternatives

update-alternatives --install /usr/bin/java java ${JHome%*/}/bin/java 20000
update-alternatives --install /usr/bin/javac javac ${JHome%*/}/bin/javac 20000

re-check JHome=/opt/java-oracle/jdk1.7.0_55 is set to the correct directory

Verify or set Oracle’s JAVA 7 to be used as a default JAVA on the system

update-alternatives --config java

There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
0 /opt/java-oracle/jdk1.7.0/bin/java 20000 auto mode
1 /opt/java-oracle/jdk1.7.0/bin/java 20000 manual mode
2 /opt/java-oracle/jdk1.7.0_45/bin/java 20000 manual mode
* 3 /opt/java-oracle/jdk1.7.0_51/bin/java 20000 manual mode
4 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 manual mode

check JAVA version using

java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

64bit system

to enable JAVA plugin in chrome/chromium, do

mkdir /opt/google/chrome/plugins
ln -sf /opt/java-oracle/jdk1.7.0_55/jre/lib/amd64/libnpjp2.so /opt/google/chrome/plugins/

to achieve the same in firefox run

ln -sf /opt/java-oracle/jdk1.7.0_55/jre/lib/amd64/libnpjp2.so /usr/lib/firefox-addons/plugins/libnpjp2.so (/usr/lib/mozilla/plugins)

Rob Sargeant threw $.02 on this. (thanks Rob). He had to do:

cd /usr/lib/
mkdir firefox-addons plugins
cd plugins
ln -sf /opt/java-oracle/jdk1.7.0_55/jre/lib/i386/libnpjp2.so /usr/lib/firefox-addons/plugins/libnpjp2.so

to enable the JAVA plugin in his firefox
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jre-7u55-linux-i586.tar.gz -O /usr/portage/distfiles/jre-7u55-linux-i586.tar.gz

Important!!! For now, you should continue to use Java 8 because Oracle Java 9 is available as an early access release (it should be released in 2016)! You should only use Oracle Java 9 if you explicitly need it, because it may contain bugs and it might not include the latest security patches! Also, some Java options were removed in JDK9, so you may encounter issues with various Java apps. More information and installation instructions (Ubuntu / Linux Mint / Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java

Добавить комментарий

Заполните поля или щелкните по значку, чтобы оставить свой комментарий:

Логотип WordPress.com

Для комментария используется ваша учётная запись WordPress.com. Выход / Изменить )

Фотография Twitter

Для комментария используется ваша учётная запись Twitter. Выход / Изменить )

Фотография Facebook

Для комментария используется ваша учётная запись Facebook. Выход / Изменить )

Google+ photo

Для комментария используется ваша учётная запись Google+. Выход / Изменить )

Connecting to %s