0

My Build server has Open JDK 8 installed and my production server has oracle JRE 8 installed . Is it possible to compile the code in open JDK and deploy the artifact in Oracle JRE 8 ?

Spencer Bharath
  • 507
  • 2
  • 7
  • 21
  • 8
    Did you encounter a problem when you simply tried it? – f1sh Mar 13 '17 at 16:47
  • You can compile it in any Java 1.1+ and run it on any Java 8. The code base for OpenJDK 8 and Oracle JRE is almost the same, so you are highly unlikely to see a difference. – Peter Lawrey Mar 13 '17 at 16:48
  • 1
    It would be a pretty poor return for all the hassle of compiling to bytecode if at the end the result wouldn't even be compatible with other vendors' JREs. (Explicit `javac` bugs notwithstanding.) – biziclop Mar 13 '17 at 16:56
  • 1
    theoretically yes. in practice these are both software that might have bugs (or features) that *might* make them incompatible. – Eugene Mar 13 '17 at 18:08
  • there are many more JVMs than just those two. and since they are standardized platforms code should generally be compatible between them, although some minor differences may exist – the8472 Mar 13 '17 at 21:08

1 Answers1

3

Yes.

OracleJDK is based on OpenJDK and has all its features plus some more. so it should be OK to go in this direction but not the otherwise. some OracleJDK classes are proprietary and are not available in OpenJDK.

For more information see this:

Community
  • 1
  • 1
sajjadG
  • 2,546
  • 2
  • 30
  • 35