Friday, August 9, 2013

Installing Oracle JDK 7 with Netbeans Installer

I have installed Oracle JDK 7 using a special version of Netbeans installer that included JDK7.

1. RESOURCES
Oracle: http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. INSTALLATION
I went to the Oracle Java downlaod page: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click "JDK 7 + Netbeans" icon.

And I download one for my [X]Ubuntu 64bit: jdk-7u25-nb-7_3_1-linux-x64.sh

I made the downloaded file executable and ran it as root to install both JDK and Netbeans.
$ cd Downloads/
$ chmod a+x jdk-7u25-nb-7_3_1-linux-x64.sh 
$ sudo ./jdk-7u25-nb-7_3_1-linux-x64.sh
I specified /usr/lib/jvm/ as JDK installation location because all installed Java versions were there.

Test the installation.
$/usr/lib/jvm/jdk1.7.0_25/bin/java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)


3. MAKING ORACLE JDK 7 AS DEFALT JAVA

I downloaded and used galternatives to swich default Java.
$ sudo apt-get install galternatives
$ gksu galternative
See my post "Installing Alternatives Configurator (galternatives) on Ubuntu".

Test the default.
$ cd ~
$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

No comments:

Post a Comment