I know this is not strictly related to programming, if you think this should be moved please let me know.
I have a medium-sized Java server written by me where I use various libraries. I'm interested in knowing if it is possible to package the library jars inside my software Jar file without having to redistribute my source code (e.g. without having to make my software open sourced).
With packaging I mean just putting the jars inside my own jar, not their contents, and use Eclipse jarinjar loader to use them.
This is an example file structure inside the final Jar:
/mysource/*
/org/eclipse/jarinjarloader/*
/library1.jar
/library2.jar
In particular, these are the libraries I'm using:
MySQL connector/J (license: GPL)
A few libraries licensed with Apache Software License version 2.0
I want to avoid making the libraries downloadable separately because I'd like to avoid having to force each of my users to setup the classpath before running my program.
So, can I package the libraries this way?
If the license is GPL and you are running it on your server only then you are ok to use the GPL'd code in your server. If you distribute the software in any form to a user, including through the browser, then you will have to release your source code as well. If the software just sits on the backend and is never distributed then you are ok to do whatever.
If the code is AGPL then you have to release your source code even if it's behind a server if the software is interacted with in any way over the internet or otherwise by a third party.
If it's Apache licensed then you can likely use it however you wish generally.