Say I've been working on this java project for over a year, and it's necessary for this project to reference a GNU GPL licensed software library somewhere in there, then the whole thing suddenly poof has to be GNU GPL. I get it. Software that references GNU licensed software has to be GNU as well.
What if this jar file has two functions. What if it can be loaded in via a classloader in external software, or executed. Loading it in via classloader by external software will run the source that references the GNU GPL protected libraries, and therefore that software is GNU GPL. Say it outputs a file called bob.txt and inside it says "Hi, I'm Bob".
However, executing the jar file starts up a whole different package of code that never once references any of the GNU protected code. It's a program all its own. But say it can also generate a file called bob.txt, or load in an existing bob.txt, and it gives you a nice GUI for modifying all the information about bob.
Could the classloader accessed packages of the software be licensed under GNU GPL and the executable accessed packaged given its own more restrictive license?
If the answer to that is yes, does that answer remain the same if you distribute the software compiled into a jar? Keeping in mind that a jar is really not much different than a zip?