You can put .jar files in the ${JRE_HOME}/lib/ext folder to make a library available to the Java Runtime without any further CLASSPATH setting (like setting the environment variable or adding a -cp/-classpath parameter)
You can put .jar files in the ${HOME}/.groovy/lib folder to make a library available to Groovy in the same manner
This will only work on your local machine, so keep track of the libraries you use.
Another trick (for Groovy) is to add to the classpath at runtime with something like: