You can follow the same approach you used for PATH. Create a CLASSPATH variable and then export it.
Or you can try the -cp command line switch and mention the dependent jars,class files there. More details are in the link which Darryl provided.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com