I have written a small Java program which i'd like to distribute on my website. I have used a few external librarys which declare following licences: Apache License (2.0), LGPL and one API doesn't declare any licence.. It's open source though.

I have spent a lot of time and effort developing my program. That's why I thought of distributing the software so that only donators (no matter how much or little they donate) can use it to it's fullest extent. Non donators get to see a nag screen now and then with a suggestion to donate and can only download one file at a time instead of simultanious downloads. (Yeah my program does some downloading)

Can I do that without getting legal issues? On one hand I would like to distribute the complete source of my project but on the other hand that would render the limitation of functions for non-donators useless, because they could simply remove the part with the serial nr check and redistribute my software..

Under what licence should i distribute my program?

  • 3
    "one API doesn't declare any licence.. It's open source though" This is troublesome. What makes you think that something without a license would be open source? Jun 2, 2011 at 23:29

5 Answers 5


First of all: You shouldn't lie your "costumers". If only donators can use all features, its not a donation, its a regular payment.

LGPL stricly allows to be used in non-free applications, Apache License I don't know. At least you should clear the API license. Just to say "Its open source" doesn't tell you, what you are allowed to do with it. Mail the maintainer and ask him.

Of course I don't know your application. Maybe you can split it into to parts, where one is published under an OSS-license and the other part is the paid one.


Can I do that without getting legal issues?

Sure, open source does not mean free (though it often is).

But you can not use the GPL license. Just use the average shareware license.


  • 1
    The OP uses external libraries that do not allow this sort of thing - it is essentially shareware. If you use those libraries, you have to respect their terms.
    – Pekka
    May 31, 2011 at 22:40
  • 1
    At least the LGPL allows it and at least the API is a very big ? :D
    – KingCrunch
    May 31, 2011 at 22:44
  • @Pekka Terve Pekka! What do you mean with "OP"? :) I read the Apache Licence and as far as i understood it, it allows redistribution in closed source, as long as i include the disclaimer of the derivative works. So if i contact the author of the API, and tell him, what i intend to do with his software, and he gives me the okay, i should be fine? LGPL is not a problem with closed source? What about the disclaimers there?
    – user778440
    Jun 1, 2011 at 14:27
  • @user by OP, I mean you (Original Poster) :) I misremembered, I thought the Apache license had restrictions against commercial use. You just need to ship the disclamimers and copyright notices, so this may indeed be fine. +1 for @Hovertruck. However, if you publish your source code under an open license, somebody else will fork a version of it without nag screens so you should use a closed license (or rethink your business model - nagware has it tough against true Open Source)
    – Pekka
    Jun 1, 2011 at 14:30
  • Well there is very little competition in this area so I'll stick with the nag screen :) It's not like I'm expecting to get rich or or so, i only want even a chance of getting some payment for the hard work.. Maybe it's better to distribute it as closed source, since I haven't even bothered to comment most of my code and It's pretty messy.. So where should these disclaimers and copyright notices go? I wanted to keep my program as simple as possible without any installation required as in executable jar file + a settings.properties file for the user preferences.
    – user778440
    Jun 1, 2011 at 14:59

As long as you link dinamically to the LGPL-ed library you can do almoust anything with your program, includeing selling it or putting nagging screen to it. The apache license is much less strict then the LGPL. If you link statically to the LGPL-ed API you can still distribute it, but only with source code. You need to give the source to whoever buys your software. So you can't give your program without the source to anyone, thus a nagging screen is a non-sense, one can take it out and recompile it, a good example for this is FlowPlayer.

I recommend writing a new license if you want to use your own rules.

EDIT: For Java there's no such thing as static or dynamic linkage, everything is linked somewhat dynamically, yet not fully. As the writer of the license, Dave Turner said, the linking method used by Java (the use of the 'import' keyword) falls under section 6 of the license. This means you must provide a way to the user to change the version of the library you used, also reverse engineer it to debug his changes. So you don't need to give away the source, neither you need to give description of the internals of your program, but you can not deny the users to reverse engineer it (which contradicts most proprietary licenses). You still need to provide the source of library. So basically you can sell your program to non-programmer people, or who are not smart enough to decompile your program and remove the nagging.

I'm not sure, but I think other's can also publish a modified version of your program, ex.: a coder takes your limited version, decompiles, removes every limitation, compiles it and publishes your work. Don't be fooled of the idea that no one will bother doing that, I did something like this (I wrote something like, because I modified and republished an LGPL-ed program). People can go far enough when there's about money.

You might also want to write your own license where you can specify what parts of the code can not be changed if reverse engineered (ex. The User is permitted to reverse engineer the Product, but can not modify sections in the code marked with *insert mark here*), this way blocking them to remove the nagging/limitations.

  • Only the source for the LGPL'ed part must be provided.
    – hakre
    May 31, 2011 at 23:25
  • Umm, what do you mean with linking dynamically or statically to the "LGPL-ed" library.
    – user778440
    Jun 1, 2011 at 13:00
  • Added more details to the post
    – SinistraD
    Jun 1, 2011 at 20:05
  • Umm, what? Why are users allowed to redistribute my work after reverse engineering..? Can't I forbid redistributing? Does one really have to write every single part of a program by their self to have full copyright to their work?
    – user778440
    Jun 1, 2011 at 21:59
  • 1
    Okay thanks alot for all the helpful answers! I just moved every function that needs the external librarys into other classes and now my main class is free of any import declarations to external libs, and that's where all the nagging and restriction happens so i only need to forbid reverse-engineering on that class and the one that has the algorithm for serialnumber creating and checking. Great. Thanks again!
    – user778440
    Jun 1, 2011 at 23:17

Simple answer is check the fine print, there are licenses which claim if you use their stuff you should also make your code open source..

Long as this is not the case, you arent obliged to provide source, nor give it for free..


Those two licenses do allow you to redistribute a derived application under almost any license, but at the same time, you must respect the terms of those licenses.

That means, for the LGPL licensed work, you must make the source code available for it in it's entire, plus any modifications you make to it. You can modify the LGPL library, but those modifications must be distributed in source form. However, when you link to an LGPL library, you are not required to make the linked work LGPL - you can distribute it under the license of your choice.

Dynamic linking or static linking are both allowed, but it must be possible for the user of your application to swap out the LGPL library for one of thier own. Dynamic linking is usually used to make this simpler. If you are static linking and don't want to distribute your source code - you must distribute the compiled object files for that code so that someone can link their own.

The apache license is even less restrictive than the LGPL. You can take Apache code and embed it directly into your application, or link it - and still distribute your code under a license of your choice.

@Hovertruck is mistaken by saying that you cannot use the GPL - infact, you can. The LGPL explictly allows relicensing of the work under the GPL. You can also license Apache derived work under the GPL.

A possible licensing strategy for you to use is to distribute a "reduced" version of your application under the Apache license (or other similar), and distribute a more compilete version under a proprietary license of your choice.

  • I still don't understand what you all mean by "linking".. What I have done whith the libs is included them in my build path and used some of the classes and methods of the librarys in my code. I've not modified any of them. Swapping the library would mean that the new one would have to have the same package, class and method names for the program to work..
    – user778440
    Jun 1, 2011 at 17:57
  • Yeah, they'd need the same names to work, but the internal implementation of the functions in the lib can change, and the LGPL requires that anyone can change it for any application using the libraries. When you build your app, it first compiles each code file into an object file, and then the next stage is that all those object files are linked with any external libs. The LGPL requires that you provide the object files so that someone can do the linking stage themselves.
    – Mark H
    Jun 1, 2011 at 18:08
  • well i guess i do provide the object files, since the jar file is practically an archive.. It contains the external jar files and all class files.. right? Maybe someone would be so kind and check out the app and maybe give some hints about writing the EULA. It's probably badly written and full of grammar mistakes since i'm not a native speaker, but thats not the problem, i'll have someone look into it who is a native english speaker. If you could point out if i've missed this and can't say that or whatever, i'd really appreciate it.
    – user778440
    Jun 1, 2011 at 20:40
  • Here's the link to the website: link
    – user778440
    Jun 1, 2011 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.