I have a jar file that mentions the main class in the manifest. When I try to execute a jar using the following command
java -cp .;./* com.foo.MainClass
The code runs and works.
When I try to execute a jar using the following command
java -cp .;./* -jar myjar.jar
I get the not found execptions class for some jars that are in the same folder as myjar.jar. I hope the -cp option will include these banks in the class path. I changed my code to print the java.class.path property. In the first case, he listed all the banks in the current directory, in the second case, he simply listed myjar.jar
I also modified the manifest to add a Class-Path element to it with all the banks. Then the second team works. But in my code I am trying to load the aribtrary class, whose name is indicated on the command line, so I want the class path to contain all the banks in the folder. How to get the second team to work in this scenario?
source share