So I am working on a multithreaded client server program in java, and occasionally the server side of the program needs to start a new Thread of a class which I have made that implements Runnable. The problem is that the Runnable class uses classes from a jar file that I have in its same directory.
When I run the Thread program on my own and I include the -classpath flag and specify the jar's classpath, it works fine. However, when I start the Thread from inside the server program, it does not work properly (presumably because it cannot find the jar). So my question is, is there a way to start the Thread of the Runnable from inside the server program with some reference to the jar so that it can use the classes that it needs from the jar?
(The jar is some sqlite-jdbc thing so I can access a database from inside my code)
Thanks in advance for any help.