Assuming you have the source file HelloWorld.java containing the following simple Java program:
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!") ;
}
}
you can compile the program with:
$ javac HelloWorld.javawhich should (if all goes well) produce the output class file HelloWorld.class.
You can then run that class file with:
$ java Helloworld