1. Say you have write a simple program Hello.java, which will print "Hello World", for example the program is in directory called D:\temp
public class Hello{ public static void main(String[] args){ System.out.println("Hello World"); } }
2. Launch a command window, and go to folder D:\temp
javac Hello.java3. Here is the important part:
java -cp . Hello
Note:
-cp is the option to specify where the class path is,
. means the current folder, you can also specify a detail folder like D:\temp
If you find this blog is useful, please kindly click the ads on this page to help. Thank you very much.
No comments:
Post a Comment