Home > Java > javaTutorial > body text

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

黄舟
Release: 2017-02-21 09:50:10
Original
2060 people have browsed it

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
Copy after login

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
Copy after login

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)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!