Pages

Wednesday, October 17, 2012

How To Install Oracle Java 7 (JRE 7 & JDK 7) On Ubuntu 12.10 (Quantal Quetzal)



Ubuntu 12.10 is about to show up in its stable version this week. Users and developers who want to run or develop Java applications and applets on Ubuntu must have a copy of Java 7 (Update 7) installed on their systems. In this tutorial we will show you how to install JRE7 & JDK7 in Ubuntu 12.10 Quantal Quetzal or older. The tutorial is also applicable for Linux Mint 13 or older.


JRE 7 Installation


Open the terminal and run the following commands to install JRE7:

sudo sh -c "echo 'deb http://www.duinsoft.nl/pkg debs all' >> /etc/apt/sources.list"

sudo apt-get update

sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB26B26

sudo apt-get update

sudo apt-get install update-sun-jre

JDK 7 with NetBeans 7.2 Installation

   - i386/32-bit Systems:

cd /tmp

wget -c --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://goo.gl/g9cJl" -O jdk-7u7-nb-7_2-linux-i586-ml.sh

chmod +x jdk-7u7-nb-7_2-linux-i586-ml.sh

sudo sh jdk-7u7-nb-7_2-linux-i586-ml.sh

   - amd64/64-bit Systems:

cd /tmp

wget -c --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://goo.gl/AJ1oS" -O jdk-7u7-nb-7_2-linux-x64-ml.sh

chmod +x jdk-7u7-nb-7_2-linux-x64-ml.sh

sudo sh jdk-7u7-nb-7_2-linux-x64-ml.sh

Then follow setup instructions without changing anything:



After you finish the installation, run this sequence of commands:


sudo mkdir -p /usr/lib/jvm/

sudo cp -R /usr/local/jdk1.7.0* /usr/lib/jvm/

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_07/bin/javac 1

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_07/bin/java 1

You can choose the Java version you want to use with this command:

sudo update-alternatives --config java 


To check if Java 7 is well installed on your system, open this link and click on "Verify Java Version". If it is installed correctly, you may see this:

No comments:

Post a Comment