Does java -jar option alter classpath options

前端 未结 3 1893
悲哀的现实
悲哀的现实 2021-01-12 17:12

I have a jar file which mentions the main class in the manifest. When I try to execute the jar using the following command

java -cp .;./* com.foo.MainClass
<         


        
3条回答
  •  半阙折子戏
    2021-01-12 18:09

    From this,

    An executable JAR must reference all the other dependent JARs it requires through the Class-Path header of the manifest file. The environment variable CLASSPATH and any class path specified on the command line is ignored by the JVM if the -jar option is used.

提交回复
热议问题