java - Run class in Jar file -
if have jar file called myjar.jar
located in /myfolder , want use class called myclass
it, how go doing command line?
i thought go directory , java -cp myjar.jar.myclass
isn't working. appreciated.
use java -cp myjar.jar com.mypackage.myclass
.
if class not in package
java -cp myjar.jar myclass
.if not within directory
myjar.jar
located, can do:on unix or linux platforms:
java -cp /location_of_jar/myjar.jar com.mypackage.myclass
on windows:
java -cp c:\location_of_jar\myjar.jar com.mypackage.myclass
Comments
Post a Comment