Chris Jones c95dc2660e lint java readme | 6 年之前 | |
---|---|---|
.. | ||
README.md | 6 年之前 |
To build and run a Java program, ie. HelloWorld.java from a CLI
Ex HelloWorld.java
import java.io.*;
public class HelloWorld {
public static void main ( String[] args)
{
System.out.println("Hello, Java!\n");
}
}
Compile the HelloWorld.java
/path/to/javac /path/to/HelloWorld.java
The above command should generate a Java class file in the same directory of the HelloWorld.java file.
To run the HelloWorld.class program
/path/to/java /path/to/HelloWorld
Omit the .class extension when running a Java program from a CLI