Some ways to run a Jar file:
If you build a jar file as runnable, then themanifest will be created automatically. Otherwise you need to add manifest intoMETA-INF/MANIFEST.MF:
Main-Class: com.mypackage.MyClass (with a new line)
Now run a jar file:
1. java -cp path/to/file.jar my.classpath.ClassContainsMainMethod
2.java -jar <jar-file-name>.jar (with a runnable jar)
Không có nhận xét nào:
Đăng nhận xét