Slashdot Mirror


LGPL is Viral for Java

carlfish writes "According to this post to POI-dev, Dave Turner (Mr License) of the FSF has decreed that the steps required to use an LGPL'd Java library will actually infect client code with substantial GNU-ness via Section 6 of the LGPL. (The "Lesser" GPL is supposed to protect only the Library, without infecting code using the library) This, as you might imagine, puts a few LGPL Java projects that previously thought they were embeddable without being viral in a bit of a bind. Various weblogs have further coverage." Update: 07/18 02:44 GMT by CN : The FSF's Executive Director, Brad Kuhn adds "LGPL's S. 6 allows you to make new works that link with the LGPL'ed code, and license them any way you see fit. Only the LGPL'ed code itself must remain Free. Such 'client code' can even be proprietary; it need not be LGPL'ed."

28 of 717 comments (clear)

  1. LGPL: Lesser General Public License by jbuilder · · Score: 2, Informative

    I have had physical relations with other humans and even *I* know what this is. It's the GNU Lesser General Public Licnese...

    You can read about here: http://www.gnu.org/copyleft/lesser.html

    Now if you'll excuse me I need to go back to my mundane life of co-mingling with other humans...

    Oh and they're female in case you're wondering...

    --
    Polymorphism -- It's what you make of it.
  2. Re:great, microsoft succeed again by TheRaven64 · · Score: 3, Informative
    [microsoft] coined the term "viral" with respect to software licenses, and now everyone's using it.

    Are you sure? My 1992 copy of the New Hacker's Dictionary contains a reference to the `General Public Virus', and I don't recall MS even having heard of the GPL back then...

    --
    I am TheRaven on Soylent News
  3. The issue is late-binding. by carlfish · · Score: 4, Informative

    The general "nerd on the street" understanding of the LGPL is that so long as you don't make any changes to an LGPL Library, then making use of that library doesn't place your own code under any further obligation.

    Section 6 contradicts that understanding. However, Java programmers have generally believed that Section 6 does not apply to them, because Java is a late-binding language. The LGPL talks about "linking executables", but Java doesn't perform the linking step until runtime, supposedly freeing Java of the Section 6 responsibilities to give an offer (valid for three years) to distribute the LGPL'd library source themselves, plus anything you would need to make the app work with a modified version of the library.

    The advice that Section 6 actually _Does_ apply to late-binding languages places a significant burden on projects making use of LGPL'd libraries that until now they didn't think they had to meet.

    --
    The more I learn about the Internet, the more amazed I am that it works at all.
  4. Re:The GPL is like a Vaccine by mjmalone · · Score: 4, Informative

    Ok, I'm not quite sure you understand what they mean by "viral" here. I think what they are saying is that code written that includes the LGPL'd Java libraries inherets the LGPL. So basically, if you include one of these libraries your code MUST be LGPL'd. This is obviously a problem.

  5. Re:The phrase in question seems to be: by Anonymous Coward · · Score: 1, Informative

    I think a simple separate jar of the LGPL ought to be enough. The reason is simple, what you propose is a runtime instantiation. Thanks to the Java class loading mechanism this already happens.

    Lets look at the basic mechanisms of java

    a) A library simply is a class file nothing more nothing less
    b) A jar file is a collection of libraries bundled to a compressed zip file + optional execution info

    c) Java does nothing than to uncompress the libraries already present on the disk on the fly.

    d) The linking to this library happens after program startup at the first time a class is called, hence the singleton pattern really does lazy instantiation even of a class and therefore of a library.
    Ever library/class has to be decompressed from a jar or loaded directly from the disk. It is copied into memory and this is done at the first time the class is called in a program. It has to pass an already running class loader (which is a java class itself) and the program already has already entered main at this stage if I interprete my runtime and debugging experience correctly.

    Now lets look at the problematic sections:

    >A suitable mechanism is one that (1) uses at run time a >copy of the library already present on the user's computer
    >system

    This describes exactly the class loading mechanism for class files lying around on the file system or for separate jar files, maybe even LGPL code bundled into a jar can be applied to it
    (this is very vague however)

    Whoever did the analysis did not know what a class loader is. .Net however could be more on the problematic side here, since it uses as far as I recall some kind of mem dump, a real linking more or less.

  6. Misleading article by timsuth · · Score: 5, Informative

    This slashdot article is misleading. It gives the impression that if your Java code uses an LGPL library then you must provide your source code, permit changes/redistribution etc.

    This is not the case. What the FSF guy way saying is "With respect to the LGPL, 'import' in Java is equivalent to linking in C." This means that if you make changes to an LGPL library you use via import in Java, you must make the changes to the LGPL library available to others. This is exactly the same situation which applies in the C world.

    The reason the Apache people don't want to use the LGPL (for any language) is that they want their libraries to be under a more permissive license which allows the libraries to be modified without requiring the users to make the changes available.

    Some people were suggesting that there was a loophole in the LGPL which meant that they could 'import' a library in Java and avoid having to make changes to the LGPL library available.

    The "news" is that the loophole does not exist - the LGPL applies to Java in the same way as it does in C.

    1. Re:Misleading article by jemfinch · · Score: 2, Informative

      Now, you want to use this in your BSD license UberChat application. You can't just use Translator, because then your app would need to be LGPL as well.


      This is where you're wrong. You can always link (2-clause) BSD licensed code with code of any other license, including the (L)GPL, without relicensing the BSD code. It's not like you link with the (L)GPL and suddenly your code is required to be less free -- your code can be released under whatever freer than the (L)GPL license you prefer, and linking with some form of the GPL won't change that.

      The (L)GPL may suddenly say that your code must be licensed under the same license, but all that means is that there's now an implicit double license in place. With your code, people can now choose between your freer BSD license, or the (possibly viral) (L)GPL license. I don't think the common choice is hard to predict...

      Jeremy
  7. Yes, that David Turner by prizog · · Score: 5, Informative

    Hi. I'm that David Turner who is quoted. I'm not the David Turner who works for Microsoft, and I do not hack on Freetype.

    First, I'm upset that CowboyNeal didn't contact me -- as the article says, I work at the Free Software Foundation, and you can find our phone number on our web page by searching for "s" on Google and clicking "I Feel Lucky."

    Now, if you read section 6 of the LGPL, it's not the same hereditary [1] thing as section 2 of the GPL -- what it says is that your program, which links against the library, does not need to be licensed under the LGPL. But you do have some obligations -- you need to allow people to relink your code with new versions of the library.

    [1] I think hereditary is a much better analogy than viral, and I thank the person who came up with it and whose name I forget.

    1. Re:Yes, that David Turner by prizog · · Score: 3, Informative

      The problem is that CowboyNeal didn't call me first.

      As a result, the article gives the wrong impression -- it implies that the LGPL is broken with respect to Java. In fact, it is not. Section 6 works for Java in the more-or-less the same way it works for C.

    2. Re:Yes, that David Turner by prizog · · Score: 3, Informative


      I cite the greater good that this will hopefully increase awareness of the obligations created under the LGPL.

      Instead, you have confused the issue further.

      Most people believe that using an LGPL library does not place any additional obligations on the person using it, so long as they don't modify the library itself. Section 6 contradicts that popular belief.

      I agree that this is a common false belief. However, Section 6 is far from secret, and anyone who distributes software should read the license before doing so.

      Similarly, people might quite reasonably believe that using a late-binding language is a way out of being considered "linked" to the library.

      FSF has always had the same views on this -- it's not really a surprise.

    3. Re:Yes, that David Turner by prizog · · Score: 5, Informative

      Oh, wait, now I actually read your post, and realize that you are still completely confused. Sorry.

      Let me make it clear: Section 6 is not what you think it is.

      You think section 6 says:

      You must cause any work that you distribute or publish, that links to the Library, to be licensed as a whole at no charge to all third parties under the terms of this License.

      Section 6 actually says: ...distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.

      Note that this does not require the provision of source code, nor does it require allowing the original program or modifications thereof to be distributed.

    4. Re:Yes, that David Turner by prizog · · Score: 4, Informative

      1. Make sure your licensing follows the simple requirements in the 1st para of section 6.

      2. Provide the LGPL library in a separate jar, and allow that jar to be replaced by newer versions of the library. This is only one of the possible ways to comply, but it's certainly the easiest.

      3. Make available the source code for the LGPL library.

  8. Bunch of Crap! by OYAHHH · · Score: 4, Informative

    This material should be considered akin to shouting fire in a crowded theatre when there isn't a spark around for miles.

    Anybody who works regularly with Java will understand the mechanics of how professionals work with provided libraries and that those same mechanisms fit perfectly with the requirements of Section 6, Part B of the LGPL.

    It's pretty obvious that the writer doesn't understand Java programming or Java systems configuration.

    To explain how Java works, basically if you want to utilize a third party library all you need to do is:

    1. Distribute Sun's (or a suitable facimile) Java Runtime Environment to your target clients.

    Note that the standard JRE comes with a ../lib/ext directory just for the explicit purpose of dropping in your libraries and any third party libraries.

    BTW, once in the ../lib/ext directory the library is effectively shared for any Java program utilizing this particular JRE installation.

    2. Put your own libraries in the ../lib/ext directory.

    3. Put the third party library in the ../lib/ext directory.

    4. Run your Java program. Note how long it takes to "load up".

    My guess is that one of the things the JRE is doing is reading those libraries to "know what it has available" and storing that info in some sort of a hashtable.

    5. During your program's execution create a object from the third party library.

    Note, that the Java interpreter merely looks up the class in the hash via an internal call that anybody can duplicate. But why when all you are duplicating what is already built-in the Java interpreter.

    If some client/end-user wants to substitute in a modified version of the third party library then there is nothing stopping them.

    They can drop in a modified or a substitute library just so long as the class names and method names, etc.. stay the same.

    Whether the program continues to work is a totally different matter.

    But the key point is is that the entire process is all dynamic. And from one run of the program to another run nothing guarantees the calling program that the third party library is actually the one that was originally installed.

    --
    Caution: Contents under pressure
  9. Please, people by Fnkmaster · · Score: 4, Informative
    Go back and read the LGPL again. The terms in Section 5/6 are not the terms commonly used with Java, sure, but the intent is pretty much crystal clear. If you use material from header files (read: interfaces or general class descriptions - the stuff that goes in header files in the C world) to make calls into the classes falls outside the scope of the license. The LGPL is no more or less befuddling with respect to Java then it is with respect to other languages. Likewise, the relationship elucidated between your object code and the LGPLed object code, whether it be in JAR or DLL format, isn't terribly different. If you contain or reuse too much of a library in your code, there's always a fuzzy, slippery slope of what constitutes a derived work. Again, this is really no different from the way the LPGL would apply to C/C++.


    So Section 5 applies just as it does with non-Java code. Likewise, Section 6 is pretty darned clear. Section 6b still applied for Java - Java runtime linking meets all the requirements of 6b. What's the big deal? As long as the LGPLed library (or it's "modified form" you distribute under your own terms, per section 6) is distributed in a separate JAR, it can be replaced by another, recompiled version of the JAR. You can change one line of code, and recompile the original library to a JAR file, distribute it under your own terms, just provide source for your "modified" version of the library, and you have complied with section 6. Voila. There's no need to jump through these hoops though, section 5 still applies, let's not get our panties in a bunch, the sky has not fallen.

  10. Re:The phrase in question seems to be: by pldms · · Score: 2, Informative

    Isn't the issue that for security reasons java requires the exact version of the jar linked against to be present and fails if you compile your own modified version?

    No, you can drop in updated jars (pace usual API compatibility issues). You might be thinking of serialisation issues that can crop up (but even then they can be worked around).

    --
    Slashdot looked deep within my soul and assigned
    me a number based on the order in which I joined
  11. Re:FSF's interpretation are not very relevant by prizog · · Score: 2, Informative

    Technically, when you "LGPL" your code, you sign away license rights for that software release to the FSF. That is why if someone violates the license of your GPL'ed program, the FSF can step in (with their lawyers) to defend your licensing rights.

    That's not true. FSF can only enforce the (L)GPL for programs on which FSF holds copyright.

  12. Re:FSF's interpretation are not very relevant by alienw · · Score: 4, Informative

    Technically, when you "LGPL" your code, you sign away license rights for that software release to the FSF. That is why if someone violates the license of your GPL'ed program, the FSF can step in (with their lawyers) to defend your licensing rights. You are still the program's copyright owner, and you can reissue your program under another license if you like (though you can't "retract" your original release).

    Pretty much everything in that paragraph is WRONG. First, unless you EXPLICITLY re-assign your copyright rights to the FSF, they do not own the copyright and cannot defend your rights. That certainly does not happen automatically. Unless your software says "copyright (C) 2003, the Free Software Foundation", it's not theirs and they cannot enforce your copyright.

    Second, if you do re-assign the rights to the FSF, you are no longer the owner and may not reissue the program under any other license. You would only have the rights afforded to you by the GPL.

    Third, you may not modify the LGPL or the GPL in any way. It violates the FSF's copyright and is not allowed. Read the license -- "Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed." (emphasis mine, obviously).

  13. Re:The GPL is not viral. by Rutulian · · Score: 2, Informative

    Nonsense. The GPL is intended to do exactly what you say it doesn't: it's intended to make all software free. It's a tool intended to destroy copyright from within.

    BS. The GPL is intended to force a give some take some trade agreement on people who use free software. If you want to make your job easier by using somebody else's code, then the GPL forces you to do a favor in turn by making your code available to make somebody else's job easier (if you want to distribute it, that is).

    It is not intended to destroy copyright (or intellectual property), it uses copyright. Without copyright there is no way it could exist. It doesn't "infect" people. And you can't "catch" it unless you want it. So aside from the idea that the license forces itself onto developers who want to distribute derivatives of GPL'd code, the term "viral" is not an accurate description. It is propaganda invented by Microsoft during their FUD campaign. All licenses have terms (BSD license included: you have to include the copyright statement). The GPL license just has more stringent terms when it comes to distribution.

  14. "Import" is syntactic sugar - nothing more by Milo77 · · Score: 2, Informative

    Import is provided so you don't have type out whole package names. It is a common misconception that it has something to do with linking. Everyone keeps saying things like "if you use import then...blah blah", but you don't have to use import - ever. You can just always use the fully qualified name: like "foo.myclass". Or you can say "import foo;" and simply refer to "myclass". That's it - no magic - it is more like a preprocessor. What about using reflection? hehe...

  15. Re:The phrase in question seems to be: by MassacrE · · Score: 2, Informative

    There are effects on your own code, or rather 'responsibilities':
    - you must allow for reverse-engineering in your license
    - you must allow linking against other versions of the library

    The problem is that these clauses are considered viral. Apache gives these rights, but doesn't require transferrance of these rights for projects which use Apache code. Once an Apache project uses LGPL code, those using the Apache project have to make these provisions in their products.

  16. That's not what Mr Turner said by p3d0 · · Score: 3, Informative
    I quote Mr Turner's statement in its entirety:
    DT: This sort of linking falls under section 6 of the LGPL.
    He does not answer in the affirmative, nor in the negative. He merely points at section 6. He does not even offer any interpretation.

    How could this be construed as saying that "LGPL is Viral for Java"?

    Maybe there's more to it in that one link that's Slashdotted.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  17. Clarification from FSF on Section 6 of LGPL by bkuhn · · Score: 4, Informative

    LGPL's Section 6 allows you to make new works that link with the LGPL'ed code, and license those new works any way you see fit. Only the LGPL'ed code itself must remain Free. Such 'client code' (as mentioned in the story posting) can even be proprietary; it need not be LGPL'ed. LGPL's Section 6 does place some requirements on what you do, but that is only to make sure that people can effectively exercise their freedoms to copy, modify, and redistribute the LGPL'ed code.

    -- Bradley M. Kuhn, Executive Director, Free Software Foundation

    1. Re:Clarification from FSF on Section 6 of LGPL by mabhatter654 · · Score: 2, Informative

      I think the issue is that in java you can use OOP to overload all the classes in a LGPL lib to do your own bidding. Then you can wrap up that LGPL .jar in another .jar for your project. At that point you've effectively rewritten the lib but are trying to bury the evidence in your .jar bytecode file. All the FSF is saying is that you can't bury stuff like that...you have to use proper calls--or make darn sure your overloading is version independant! You have to keep the LGPL .jar seperate from the rest of the program. The only issue with java is that it allows you many more ways to cheat...they're just clarifying their position on "cheating"

  18. You are not correct by michaelggreer · · Score: 2, Informative

    Turner explained himself further in subsequent posts. You simply need to follow the rules for LGPL in Java as in C (ie, package your app so that the LGPL library can be replaced simply). You state that:
    the LGPL works virtually the same as the GPL for Java code.
    Certainly you can use the LGPL for C. Therefore, what is in fact true is that
    the LGPL works virtually the same for Java as for C.

  19. Re:The GPL is like a Vaccine by NullAndVoid · · Score: 2, Informative

    Someone tell me the difference between a BSD license and just putting your code into the public domain, 'cause I would really like to know what that difference is.

    BSD style licenses require evil companies to give credit to the original copyright owner.

    --


    -- Sigs are for losers
  20. Re:And I suspect most of us feel the same way... by NullAndVoid · · Score: 2, Informative

    I believe the issue is that Apache wants to make sure downstream distributors aren't forced to comply with more restrictive licenses than the ASL.

    If I create a product based on Apache products that need to include LGPL code, I have to worry about whether my code has to be released under LGPL or else force my end users to download and install separate packages to make my product work.

    Apache doesn't want to pass the buck by not distributing LGPL code, but requiring its end users to use it themselves. Avoiding LGPL dependencies altogether is the cleanest way to ensure that the benefits of the Apache license are passed down to its users.

    Note that this isn't a feature of the Apache license, but an Apache policy. So downstream users are free to use GPL if they like, whereas GPL users aren't free to use the ASL license.

    --


    -- Sigs are for losers
  21. Re:The GPL is like a Vaccine by FooBarWidget · · Score: 2, Informative

    Uhm no. Read the GPL. You are allowed to have private code. You, only have to release the code if you distribute the binaries. If you don't distribute binaries and keep everything in-house, you won't have to release the source code either.

  22. Re:The GPL is like a Vaccine by civilizedINTENSITY · · Score: 2, Informative

    They were specific that the restriction is *not* that the code would have to be LGPLed, but rather that section 6 would be in effect. Section 6 does not LGPL the code. Section 6 does place restrictions. Not the same thing. What appears relevant (besides user notification...) is "distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications."

    David Turner summarizes, "Section 6 of the LGPL is not the same hereditary thing as section 2 of the GPL -- what it says is that your program, which links against the library, does not need to be licensed under the LGPL. But you do have some obligations -- you need to allow people to relink your code with new versions of the library, for example."