11

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.

asked Feb 21, 2013 at 17:15
2
  • 2
    I think 1.7 is the JDK and 7 is the JRE according to openjdk.java.net/install Commented Feb 21, 2013 at 17:17
  • @RNJ I don't think that one is the jre. I am on Ubuntu and I have the same case with JDK6. One of them is a symbolic link. Also, in case of JRE it is named so. However, I can speak only for Ubuntu. Also the link that you have added does not differentiate with jre and jdk based on the version format. Commented Feb 21, 2013 at 17:23

2 Answers 2

9

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

answered Feb 21, 2013 at 17:21
Sign up to request clarification or add additional context in comments.

4 Comments

yes i know what is the difference between oracle jdk and openjdk, what i don't understand is why i get two options, and not sure which to select.
hmm the one with the 1.7... is a symlink to the other : java-1.7.0-openjdk-i386 -> java-7-openjdk-i386. like @Ankit write, still don't get why it is done like that
@Nikola It is result of java versioning mess. See here stackoverflow.com/questions/2411288/…
this means that both are practically the same :), that was my question :)
3

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.

answered Jun 6, 2014 at 9:36

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.