Home  >  Article  >  Java  >  Java Example - How to execute a specified class file directory (classpath)

Java Example - How to execute a specified class file directory (classpath)

黄舟
黄舟Original
2017-02-21 09:50:102136browse

If our Java compiled class file is not in the current directory, we can use -classpath to specify the class file directory:

C:> java -classpath C:\java\DemoClasses HelloWorl

In the above command, we used the -classpath parameter to specify The directory where HelloWorld's class files are located.

If the class file is in a jar file, the command is as follows:

c:> java -classpath C:\java\myclasses.jar

The above is a Java example - how to execute the contents of the specified class file directory (classpath). For more related content, please pay attention to PHP Chinese Net (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn