To compile the .java files:
javac *.java
You can use the
-d
option to specify where to place generated class files, e.g.javac -d "build" *.java
To run the compiled code:
java <class_name>
e.g.
java HelloWorld
You can use the
-cp
option to specify the class search path, e.g.java -cp "build" HelloWorld
If you defined a package, you'll need to specify it, e.g.
java -cp "build" MyPackage.HelloWorld
No comments:
Post a Comment