Does java -jar option alter classpath options

前端 未结 3 1889
悲哀的现实
悲哀的现实 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:08

    You will need your own classloader to deal with this. -jar only respects the information in the Manifest and wildcards are not allowed there.

    You might find the example of a reloadable class useful: http://www.exampledepot.com/egs/java.lang/ReloadClass.html

提交回复
热议问题