I’m trying to follow along with the self paced training (https://training.docker.com/self-paced-training), but in the third one where a java application is built and run, on the “compose run…” command I always get a ClassNotFoundException for the redis.redis.jedis.Jedis class. I can build fine with no exceptions, and the java class file (JavaHelloWorld.class) is created as expected, as well as the image. But when I go to run it with:
docker run --link redis:redis jeff/javahelloworld java JavaHelloWorld
I get a ClassNotFoundException for the Jedis library. If I take all references to Jedis out of the code, then it all runs fine, so it’s something to do with how I’m specifying the Jedis library.
Environment: Windows with VirtualBox
COPY . .
RUN javac -cp lib/jedis-2.4.2.jar -d . ./JavaHelloWorld.java