27

From http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux

Type/Copy/Paste: java -version . If you're having

OpenJDK Runtime Environment (IcedTea6 1.10pre) (7b15~pre1-0lucid1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

... you have the wrong vendor version of Java installed for this exercise.

This is what I have. I wonder, why is this a wrong vendor? What is this vendor? Why should I use Oracle Java instead?

Incerteza
  • 1,470

1 Answers1

40

There are currently two Java versions (vendors, if you will) available:

  • Oracle's (previously Sun) JDK, the closed source Java, with commercial support from Oracle 'n stuffs.
  • OpenJDK, the open source Java. Oracle released part of their source and renamed it.

In the days of Java 6, there used to be a big difference between the two of them, OpenJDK running slower and supporting less. However, nowadays, except for the java-web-plugin (which was rewritten by the community and named icedtea-web), they are exactly the same. Neither of the two versions is "wrong".

There are still people claiming OpenJDK is worse than Oracle's JDK, but it's become a myth.

I recommend keeping OpenJDK for Java 7, because open source FTW, and because it's supported in the official repositories of Ubuntu (Oracle does not let others redistribute their JDK).

nhahtdh
  • 103
mid_kid
  • 691
  • for example, $ javac -version The program 'javac' can be found in the following packages: - should it be so with OpenJDK? – Incerteza Mar 22 '14 at 15:00
  • 2
    OpenJDK is also the reference implementation of Java SE 7, so I think that's a testament to its stability (if I'm understanding correctly what it means to be a reference implementation). – ananaso Mar 22 '14 at 17:35
  • @Alex Java (OpenJDK and Oracle) is split in two packages: The Java Runtime Environment (JRE), and the Java Development Kit (JDK). If you just want to run some java programs, the JRE is all you need. If you want to compile some java programs (javac, which stands for java compiler), you'll need the JDK. Install the JDK with sudo apt-get install openjdk-7-jdk. – mid_kid Mar 22 '14 at 19:16
  • I've stopped using OpenJDK when at version 6, because at that time, it was clearly slower than Oracle JDK 1.6. Thus, I have no hands on proof that Open JDK 1.7 is still as slow as compared to Oracle JDK 1.7. I've found however some benchamrks made by other ppl, claiming that there still is a performance difference (in favour of Oracle JDK): http://www.ilsistemista.net/index.php/linux-a-unix/37-openjdk-vs-oraclejvm-a-look-at-java-performance-under-redhat-6-3-with-specjvm2008.html?start=3 I'd like to know if there's also proof stating the contrary (as I do prefer OpenJDK's... openness :) ) – Shivan Dragon Mar 22 '14 at 22:17
  • Back when jdk6, the winner was hands-down oracle. Now, I tried running minecraft and intellij with both, and there is no noticeable difference. The only "proof" you can have is trying it yourself, the fact that openjdk is the reference implementation, and this blog post: https://weblogs.java.net/blog/robogeek/archive/2009/01/05/it-will-be-openjdk7-where-openjdkjdk – mid_kid Mar 23 '14 at 00:24
  • Also, the benchmarks show little difference between the two. It is possible that if the guy did the tests again, openjdk would win by some miliseconds. Performance differs from system to system, and benchmarks aren't as accurate as you might expect. Therefor, I suggest relying more on your experience than benchmarks. – mid_kid Mar 23 '14 at 00:32
  • @ShivanDragon, isn't the performance difference negligible? I think it is, you won't the difference at all. – – Incerteza Mar 23 '14 at 03:22
  • On Ubuntu the openJDK 6, 7 and 8 have a font bug on SWING that let the font ugly. They say that it is fixed on Oracle JDK I will test it later – deFreitas Aug 27 '15 at 13:26