6

I was looking to override a class in rt.jar with my own version (to guarantee that existing legacy code remains unbroken).

With Oracle's JDK, it says the following for the -Xbootclasspath/p:path option:

Do not deploy applications that use this option to override a class in rt.jar, because this violates the JRE binary code license.

If I switch to use OpenJDK, will I be faced with this same limitation? That is, would I be violating a license?

  • @Mureinik I edited a link to the Oracle documentation, but due to my reputation, the edit is pending peer review before it is visible. – Thomas Owens Apr 12 '16 at 11:52
  • Just approved the edit. – Matt Apr 12 '16 at 13:29
2

If I switch to use OpenJDK, will I be faced with this same limitation? That is, would I be violating a license?

There is no such limitation in the OpenJDK licensing which is a combo of CDDL and GPL with classpath exception. Run with it without fear.

As a side note, there is no good reason to use the Oracle BCL-licensed JDK. In fact reading its ever changing license terms, you can barely use it for development and that is about it. The OpenJDK is always a better alternative IMHO.

if the class I'm modifying is covered by the "Classpath Exception" to the GPL, then does your answer change at all?

No. To the contrary: the BCL does not give any permission to modify code. The GPL with Classpath does allow that alright. You still have to obey the GPL for the code you modify of course and -- unless you enter the grey area of derivative work -- your code using this modified code would not be subject to the GPL's requirements.

/IANAL /TINLA

  • Thanks Philippe! And, just one more thing, if the class I'm modifying is covered by the "Classpath Exception" to the GPL, then does your answer change at all? – Matt May 16 '16 at 13:17
  • No. See my updated answer – Philippe Ombredanne May 17 '16 at 5:21
  • Ok, thanks again! Very much appreciated. – Matt May 17 '16 at 20:21

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.