Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 930
Muhammad Gelbana Avatar asked Jul 24 '12 10:07

Muhammad Gelbana


2 Answers

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

like image 99
Andriy Plokhotnyuk Avatar answered Nov 15 '22 14:11

Andriy Plokhotnyuk


Java byte code is portable and can be executed using any JVM that has same or newer version.

like image 30
gkuzmin Avatar answered Nov 15 '22 15:11

gkuzmin