How do I run a jar class?

Lâm Phung

New member
How do I run a jar class?
Answer
5 Answers
  1. If the class is not in a package then simply java -cp myjar. jar myClass .
  2. If you are not within the directory where myJar.jar is located, then you can do: On Unix or Linux platforms: java -cp /location_of_jar/myjar.jar com.mypackage.myClass. On Windows:
 

Tìm kiếm

Back
Top