I have a toy program that is called Test.class. It accesses a class in a jar called myjar.jar. That jar is in my CLASSPATH variable set as part of my Windows environment. When I type echo %CLASSPATH%, I see C:\myclasses\myjar.jar. When I execute my program java Test
it runs fine.
But if I package the code as a jar and try running
java -jar Test.jar
It ca It can't find my classpath. I know this has a simple solution.
Can you please help me.