Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Oracle seems to license all their Java-related open source code under the GPL with a classpath exception. From what I understand, this seems to allow to combine these libraries with your own code into products that do not have to be covered by the GPL. How does this work? What are examples of how I can and cannot use these classes? Why was this new license used as opposed to the LGPL, which seems to allow for pretty much the same things, but is better established and understood? What are the differences to the LGPL?

share|improve this question

migrated from Nov 13 '11 at 1:10

This question came from our site for professional and enthusiast programmers.

I found this on wikipedia:… which clears things up a little, but I still don't understand why someone would use this over LGPL. Good question! – Abhi Beckert Nov 12 '11 at 23:45
That Wikipedia pages does not mention things like "user must be able to swap out library with his own version" which are provisions of the LGPL. So maybe GPL+Exception does not require that? – Thilo Nov 12 '11 at 23:48
Reading on, that does seem to be the case: "LGPL formulates more requirements to the linking exception: you must allow modification of the portions of the Library you use and reverse engineering (of your program and the library) for debugging such modifications" – Thilo Nov 12 '11 at 23:49
In this case, what am I not allowed to do under this license? I can copy licensed code (pick+choose classes) into my own codebase (unmodified of course)? Can I use automated build tools to modify the resulting binary? Obfuscators, minimizers, dead-code strippers? – Thilo Nov 12 '11 at 23:52
Shouldn't you be talking to a lawyer about this? – Doug Nov 12 '11 at 23:55

GPL with classpath exception behaves like LGPL for most uses.

It does mean you need to be able to ship the source for the library on demand. It does not mean you need to be able to ship your own source. It happens mean you don't have to ship a way to replace the library if you statically link against it, but you cannot use a public key to prevent replacement.

share|improve this answer

It looks like the "GPL with classpath exception" style licenses may be older than LGPL.

Perhaps the only reason anyone still uses it, is because GPL code cannot be migrated to LGPL code without written permission from everyone who ever contributed code.

share|improve this answer
The first version of the LGPL was released in 1991, so that predates Java. – Thilo Nov 12 '11 at 23:55
It predates java, but does it predate all of the code inside Java? Perhaps the first release of Java contained code from some older "GPL with classpath" project. – Abhi Beckert Nov 13 '11 at 0:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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