Only load tests.jar when actually testing

This restrictes the loading of tests.jar to when the Java tests are actually
being run.