121

I have been using OpenJDK for ages, initially for small projects where it has no problems. But since I started to play with it for big toys, I started to notice random/unknown fatal error and crashes (with H.264 codecs, etc.), and it was a nightmare till then to get ride of system crash+fatal errors caused by OpenJDK.

After getting completely frustrated and tired with OpenJDK, I finally decided to switch into Oracle JDK 7. Since then my fatal errors/crashes were gone. I am still doing trace to see if it occurs, but I never got those system crashes yet.

Now I am wondering, if OpenJDK is only a license issue, why is stability impossible with it?

Why does OpenJDK keep bugs alive, inside their stable releases, but claiming that its clone of Oracle JDK (which it is not really), then what really technically separates OpenJDK from Oracle JDK? (only quick features availability? Or focused on stability/reliability?)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

2 Answers2

76

Technical differences are a consequence of the goal of each one (OpenJDK is meant to be the reference implementation, open to the community, while Oracle is meant to be a commercial one)

They both have "almost" the same code of the classes in the Java API; but the code for the virtual machine itself is actually different, and when it comes to libraries, OpenJDK tends to use open libraries while Oracle tends to use closed ones; for instance, the font library.

morgano
  • 17,210
  • 10
  • 45
  • 56
  • 71
    This isn't quite true as of Java 7 when Oracle replaced a number of closed source parts with their open source equivalent. The code for the virtual machine is actually almost completely identical, but there are a couple of libraries (such as the font one) which are closed. – Martijn Verburg Aug 27 '13 at 19:26
  • Wow, such confuse. So after Java 7, when you package an app with OpenJDK-JRE, it's **identical** to packaging it with Oracle ServerJDK-JRE? – Pacerier Jul 28 '17 at 16:10
72

OpenJDK is a reference model and open source, while Oracle JDK is an implementation of the OpenJDK and is not open source. Oracle JDK is more stable than OpenJDK.

OpenJDK is released under GPL v2 license whereas Oracle JDK is licensed under Oracle Binary Code License Agreement.

OpenJDK and Oracle JDK have almost the same code, but Oracle JDK has more classes and some bugs fixed.

So if you want to develop enterprise/commercial software I would suggest to go for Oracle JDK, as it is thoroughly tested and stable.

I have faced lot of problems with application crashes using OpenJDK, which are fixed just by switching to Oracle JDK

fzzylogic
  • 2,183
  • 1
  • 19
  • 25
ajay_t
  • 2,347
  • 7
  • 37
  • 62
  • 8
    Not entirely correct that Oracle JDK is closed source. Every copy of the Oracle JDK comes with src.zip which contains many of the source files in jdk. – pushNpop Apr 07 '15 at 01:30
  • 12
    re "lot of problems with application crashes using OpenJDK", please list them? – Cheeso May 05 '15 at 20:29
  • 16
    Cheeso , here is the list https://bugs.openjdk.java.net/issues/?jql=project%20%3D%20JDK%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20%3D%20Unresolved%20ORDER%20BY%20priority%20DESC – rajeshnair May 18 '15 at 04:48
  • 9
    I recently ran into problems with code using URLConnection to poll a data source over HTTP. Worked fine with Oracle JDK 7 & 8, but would intermittently lose cookie headers with OpenJDK 7 & 8. I was really hoping that something like HttpUrlConnection would be uniform across both now... In the end switching to Apache HttpClient saved me from having to install Oracle JDK. Another instance: OpenJDK 8 doesn't support TLS_ECDHE cipher suites, though it does support TLS_DHE. It's a bummer, but I'll sacrifice some CPU to keep my EC2 deployments simpler – SurlyDre Sep 05 '15 at 02:11
  • 11
    @rajeshnair, that is the unresolved bug list of OpenJDK, NOT mean "are fixed" in Oracle JDK! – Bùi Việt Thành Apr 17 '16 at 17:02
  • 2
    @BùiViệtThành, Where is Oracle's JDK bug list **then**? – Pacerier Jul 28 '17 at 16:20
  • 2
    @Pacerier, since there's is a big overlap between the code bases, it's a safe bet that the above *is* the bug list also for Oracle JDK. – aioobe Sep 22 '17 at 21:46
  • @pushNpop you cannot build the JRE with the contents of src.zip – Thorbjørn Ravn Andersen Dec 09 '17 at 03:56
  • Note with the new release model for java, Oracle plans to reduce the gap as much as possible between both jdk's. Are there other open source contributors to open jdk other than oracle developers? This is to understand if there would be enough support to backport a fix from the latest version to the previous version. Any thoughts? – Andy Dufresne May 10 '18 at 05:36