Why should I use the Oracle JDK over the OpenJDK, or vice-versa? [closed] - OracleConnections2024-03-29T10:56:18Zhttp://www.oracleconnections.com/forum/topics/why-should-i-use-the-oracle-jdk-over-the-openjdk-or-vice-versa?commentId=6612035%3AComment%3A36554&feed=yes&xn_auth=noOne big difference is that th…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:367302013-09-16T13:22:13.111ZGreta Leahttp://www.oracleconnections.com/profile/GretaLea
<div class="post-text"><p>One big difference is that the documentation is different. I don't know if Sun released the docs in a license that is compatible with OpenJDK, but they are using (from my experience) the GNU classpath documentation, which is nowhere near as good.</p>
<p>Sun has great documentation, and you can still use their docs if you want to use OpenJDK, but that could cause confusion if OpenJDK has implemented it differently.</p>
</div>
<div class="post-text"><p>One big difference is that the documentation is different. I don't know if Sun released the docs in a license that is compatible with OpenJDK, but they are using (from my experience) the GNU classpath documentation, which is nowhere near as good.</p>
<p>Sun has great documentation, and you can still use their docs if you want to use OpenJDK, but that could cause confusion if OpenJDK has implemented it differently.</p>
</div> In my project am using Sun JD…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:367262013-09-16T13:20:06.865ZDraven Jordenhttp://www.oracleconnections.com/profile/DravenJorden
<p>In my project am using Sun JDK, earlier we had Open JDK but it gave font issues. So we moved to Sun JDK.</p>
<p>In my project am using Sun JDK, earlier we had Open JDK but it gave font issues. So we moved to Sun JDK.</p> I found recently that there a…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:367232013-09-16T13:18:43.167ZEfrain Justinhttp://www.oracleconnections.com/profile/EfrainJustin
<div class="post-text"><p>I found recently that there are differences in PrintWriter implementation when used with multithreading: try creating a PrintWriter object and use it in different threads, I was using format and checkError methods, PrintWriter methods are threadsafe AFAIK (on an invididual call basis); Sun JDK appeared to be correct in implementation in the sense that I saw the effects by way of mingled output (multiple calls were made to above methods to produce output, only…</p>
</div>
<div class="post-text"><p>I found recently that there are differences in PrintWriter implementation when used with multithreading: try creating a PrintWriter object and use it in different threads, I was using format and checkError methods, PrintWriter methods are threadsafe AFAIK (on an invididual call basis); Sun JDK appeared to be correct in implementation in the sense that I saw the effects by way of mingled output (multiple calls were made to above methods to produce output, only individual calls are threadsafe unless the full loop producing output is synchronized explicitly). Open JDK however had no issues - in my tests, the threads had their outputs cleanly separated, so it would appear to protect in case of 'goofy' code it appears.</p>
<p>Just one example. This might fall within the 1% code people are saying is different, I haven't checked the two JDKs' code myself yet actually.</p>
</div> Basic approach to the problem…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:366532013-09-16T13:16:28.674ZErnie Benaventehttp://www.oracleconnections.com/profile/ErnieBenavente
<div class="post-text"><p>Basic approach to the problem should consider - what would be the path going forward.</p>
<p>The SunJDK is going to be more-and-more proprietary code going forward.</p>
<p>And OpenJDK makes a lot more sense - to be true to the Java spirit that Sun Microsystems [not Oracle] had espoused right from the beginning</p>
<p>Besides with OpenJDK you are assured of portability - because of known standardised API's</p>
<p>With SunJDK - no one knows where its headed.</p>
<p>Just…</p>
</div>
<div class="post-text"><p>Basic approach to the problem should consider - what would be the path going forward.</p>
<p>The SunJDK is going to be more-and-more proprietary code going forward.</p>
<p>And OpenJDK makes a lot more sense - to be true to the Java spirit that Sun Microsystems [not Oracle] had espoused right from the beginning</p>
<p>Besides with OpenJDK you are assured of portability - because of known standardised API's</p>
<p>With SunJDK - no one knows where its headed.</p>
<p>Just my two cents...</p>
</div> With openjdk, you have the so…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:365542013-09-16T13:14:39.579ZTari Shinglerhttp://www.oracleconnections.com/profile/TariShingler
<p>With openjdk, you have the sound mixer working : i.e you won't have error like "the current audio device is currently in use" : with SunJdk, if your java program tries to play a sound while another program is already playing, it won't work, which is lame :/</p>
<p>With openjdk, you have the sound mixer working : i.e you won't have error like "the current audio device is currently in use" : with SunJdk, if your java program tries to play a sound while another program is already playing, it won't work, which is lame :/</p> I have been doing some CS res…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:367182013-09-16T13:13:51.136ZMarquis Despreshttp://www.oracleconnections.com/profile/MarquisDespres
<p>I have been doing some CS research where the program I am working on is written mostly in C but uses the JNI for some new tasks (eventually the whole program will be translated into java) Anyway... I was doing test runs on two different machines and one was completing the tests and the other was getting stuck. It turns out that the difference was the first machine had sun-jdk and the other had open-jdk. When I installed sun-jdk on the machine, it was able to complete the tests. So somewhere…</p>
<p>I have been doing some CS research where the program I am working on is written mostly in C but uses the JNI for some new tasks (eventually the whole program will be translated into java) Anyway... I was doing test runs on two different machines and one was completing the tests and the other was getting stuck. It turns out that the difference was the first machine had sun-jdk and the other had open-jdk. When I installed sun-jdk on the machine, it was able to complete the tests. So somewhere there is a difference between the two. Possibly in the way they implemented the JNI? If thats the case it likely wouldn't effect a normal user.</p> If it is just a private proje…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:366462013-09-16T13:12:43.437ZRichard Hameshttp://www.oracleconnections.com/profile/RichardHames
<div class="post-text"><p>If it is just a private project it does not matter really, I guess.</p>
<p>But if you develop for a public/commercial project ask the operations what the official supported environment is. Even if the environments (devel vs. production) are 99% identical you should always use the official supported and tested version.</p>
<p>In a real case the used jre vendor was not communicated correctly (ibm vs. sun). We developed/tested our software with sun. One day on production…</p>
</div>
<div class="post-text"><p>If it is just a private project it does not matter really, I guess.</p>
<p>But if you develop for a public/commercial project ask the operations what the official supported environment is. Even if the environments (devel vs. production) are 99% identical you should always use the official supported and tested version.</p>
<p>In a real case the used jre vendor was not communicated correctly (ibm vs. sun). We developed/tested our software with sun. One day on production a jre-bug popped up, which never happened on development environment, because different jre-versions were used. aargh!</p>
</div> Oracle JDK 7 is built from Op…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:366412013-09-16T13:11:42.375ZKeneth Braganhttp://www.oracleconnections.com/profile/KenethBragan
<p>Oracle JDK 7 is <a href="https://blogs.oracle.com/henrik/entry/moving_to_openjdk_as_the">built from OpenJDK</a>, quote "Moving to OpenJDK as the official Java SE 7 Reference Implementation":</p>
<p>Oracle JDK 7 is <a href="https://blogs.oracle.com/henrik/entry/moving_to_openjdk_as_the">built from OpenJDK</a>, quote "Moving to OpenJDK as the official Java SE 7 Reference Implementation":</p> There have been a lot of good…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:367132013-09-16T13:07:53.857ZLazaro Engstromhttp://www.oracleconnections.com/profile/LazaroEngstrom
<div class="post-text"><p>There have been a lot of good answers by a lot of much better programmers than I. However as a part-developer part-sysadmin of Java Applications I can offer one further suggestion.</p>
<p>While the other answers are very important to consider, regarding the choice between OpenJDK and Oracle JDK primarily, my decision is generally about 90% dependent on.... what the <strong>core developers of the target platform or software are using</strong>.</p>
<p>That sounds a bit…</p>
</div>
<div class="post-text"><p>There have been a lot of good answers by a lot of much better programmers than I. However as a part-developer part-sysadmin of Java Applications I can offer one further suggestion.</p>
<p>While the other answers are very important to consider, regarding the choice between OpenJDK and Oracle JDK primarily, my decision is generally about 90% dependent on.... what the <strong>core developers of the target platform or software are using</strong>.</p>
<p>That sounds a bit simplified, but it really does work well.</p>
<p>For example, we have a client with a ERB/Glassfish/Java EE/netbeans platform. Initially I tried running that on a CentOS machine with OpenJDK 1.6. However there were continual problems and cases requiring submitting bug reports etc. It turns out that the fixes are already in the Oracle patches, but won't make it to the CentOS/RHEL repos for 6 months.</p>
<p>I have had an opposite experience with tomcat on CentOS, in that the CentOS/Apache/MySQL/Tomcat stack is a very well tested set of packages in the RHEL ecosystem. This also applies to Ubuntu ecosystem now they are shipping OpenJDK.</p>
<p>I originally learned my lesson on this one, with trying to run the configuration management tool Chef, by using the RPM packages from the CentOS repos, and they were always 6 months behind. <strong>It turns out that the developers focused on releasing to rubygems</strong> first, and once I realised I was just making it hard for myself, it went much more smoothly.</p>
<p>There are loads of little things that add up to make the case, for example just submitting a bugfix, its might be hard to get a core-developer to take a look at it, because they don't have a box with OpenJDK installed...</p>
</div> OpenJDK will give you new fea…tag:www.oracleconnections.com,2013-09-16:6612035:Comment:365502013-09-16T13:01:34.169ZYung Shotwellhttp://www.oracleconnections.com/profile/YungShotwell
<p>OpenJDK will give you new features faster, Sun JDK should give you more stability.</p>
<p>OpenJDK will give you new features faster, Sun JDK should give you more stability.</p>