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

I have recently become curious about open source licenses. I have a question about the LGPL. I created a Java web project and built it as a WAR package. Can I add LGPL jars to this WAR file?

share|improve this question

migrated from Jan 5 '12 at 3:03

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

AFAIK as long as you use the LGPL API without making any modifications to the library, your work won't be considered as derivative work, and thus you can release it under any terms. There are other requirements particularly when you redistribute the library with your code so if you plan to distribute your code, you should make sure you follow the terms of the actual license. – Enno Shioji Jan 4 '12 at 7:26

Warning: I am not a lawyer. If you need legally sound advice, always ask a lawyer. In this case, ask a lawyer who understands open source licensing.

The following is a summary:

  • If you don't distribute the WAR file to anyone else, then LGPL places no restrictions on what you do with the library.

  • If you do distribute the WAR file to someone else, you have two options:

    1. Release your source code under a license that is compatible with the GPL or LGPL, OR ...

    2. Use the LGPL'ed libraries in your code without modifying the libraries, AND without linking or incorporating the libraries into your code in a way that prevents the recipient from replacing them with a modified copy of the libraries.

(Assuming that the library in question is Java, option 2 means that you have to use the library JAR file as-is. Don't add your own customizations / fixes, don't change class or package names (etc), don't add classes, and don't merge it with your own JAR files.)

For more information, please refer to the GNU Lesser Public License page.

share|improve this answer
If customization is needed, he can do it, but then must release modified library under LGPL. Noone else probubly will not find it usefull, other versions of original library will not be possible to use, but other version of his modified library (eg. user repairing bug in it) will be usable and that is what he is using. – user470365 Jan 4 '12 at 8:20
thanks,I got it – Kevin Shen Jan 4 '12 at 15:46

Your Answer


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