Search code examples
cross-compilingjava-6java

Is it possible to compile java using Oracle JDK and run the code on OpenJDK?


So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?

If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on windows, what is the least compatible OpenJDK version I should have on Ubuntu server ?


Solution

  • Mostly yes, but for corner cases it depends and should be carefully tested on stage that match closely to production configuration.

    Here are examples of compiler crash and test failure that occurs on OpenJDK, while the same snapshot of sources are green when build by Oracle JDK:

    http://travis-ci.org/#!/plokhotnyuk/actors/builds/1948184

    http://travis-ci.org/#!/plokhotnyuk/calculator/builds/1948194