GPL or LGPL?
Java uses dynamic linking at runtime. Using the reflection API and class loading, the linking can be completely data driven, specifying classes and methods by name. This moves the legal issues of using GPL’ed Java code into the user’s hands, as a violation of the GPL can not be proven from the executable itself. Unlike plugins, Java classes do not even have to have a specific structure to be used in such ways. By using native methods and selecting DLL’s at runtime, this problem might also affect native code. Example: a GPL’ed Java dependency checker using the reflection API. Java’s runtime linkage, in particular the reflection API, blurrs the lines between code and data even more than e.g. native plugins. If you want to write Java code that can be used without the user having to worry about licensing issues, consider using the Lesser GPL (LPGL). If you want to avoid seeing your classes and packages being used by non-free software, consider using the GPL license.