Nikola
Nikola

Reputation: 554

what is the difference between java-1.7.0-openjdk-i386 and java-7-openjdk-i386

when i install netbeans it gives me the option to select the java environment, i have 3 options, the oracle java and these two (java-1.7.0-openjdk-i386 and java-7-openjdk-i386). what is the difference between these two?The os if ubuntu.

Upvotes: 11

Views: 11246

Answers (2)

Rishi Dua
Rishi Dua

Reputation: 2334

You installed it twice

From openjdk, following instructions from here

sudo apt-get install openjdk-7-jdk

From Stackoverflow, following instructions from here

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Would recommend the second one and remvong the first one by typing

sudo apt-get remove openjdk-7-jdk.

Upvotes: 3

Ankit
Ankit

Reputation: 6980

The two OpenJDK are same. However OpenJDK is slightly different from Oracle JDK. Read this post for more clarification.

The reason why you are getting two options for OpenJDK is PROBABLY that you have two copies of OpenJDK installed (or two different references to the same directory on your system.)

For further investigation, try to ls -lh /usr/lib/jvm. The /usr/lib/jvm is usually the directory where Java gets installed. Check if one of them is a symbolic link. Also, check in netbeans the location of the two JDK and see if in fact you have two versions or references of Java on the system.

For example, here is the output of ls -lh on my system:

ls -lh
total 24K
lrwxrwxrwx 1 root  root    26 Sep 10 13:41 default-java -> /usr/lib/jvm/java-7-oracle
lrwxrwxrwx 1 root  root    18 Mar 13  2012 java-1.5.0-gcj -> java-1.5.0-gcj-4.6
drwxr-xr-x 7 root  root  4.0K Aug 22  2012 java-1.5.0-gcj-4.6
lrwxrwxrwx 1 root  root    19 Jun 26  2012 java-1.6.0-openjdk-i386 -> java-6-openjdk-i386
drwxr-xr-x 3 root  root  4.0K Feb 15 10:52 java-6-openjdk-common
drwxr-xr-x 7 root  root  4.0K Feb 15 10:52 java-6-openjdk-i386
drwxr-xr-x 8 ankit ankit 4.0K Jun  6  2012 java-6-sun
drwxr-xr-x 5 root  root  4.0K Aug 22  2012 java-7-openjdk-i386
drwxr-xr-x 8 root  root  4.0K Feb 20 10:40 java-7-oracle
lrwxrwxrwx 1 root  root    12 Mar 13  2012 java-gcj -> java-gcj-4.6
lrwxrwxrwx 1 root  root    18 Apr 16  2012 java-gcj-4.6 -> java-1.5.0-gcj-4.6

As you can see java-1.6.0-openjdk-i386 is just a symbolic link/reference to another directory named java-6-openjdk-i386

Upvotes: 9

Related Questions