
上QQ阅读APP看书,第一时间看更新
Running a project that is placed inside a runnable JAR file
For JAR files that are properly configured to run automatically (as discussed earlier, not every JAR file is), you can use this form of the java command:
java -jar PATH
Substitute PATH with the path, either absolute or relative to the corresponding JAR file. If the JAR file is configured correctly, the program will now run.
Note that setting a class path is not possible on this form. A JAR archive file is required to include all the required dependencies. The CLASSPATH environmental variable and the -cp and -classpath parameters of the java command will be ignored.