Java Tools Tutorials - Herong's Tutorial Examples - v6.23, by Herong Yang
Launching Hello.java - My First Java Program
This section provides a tutorial example on how to launch a simple java program using the 'java' tool without any options.
To test the Java launcher, 'java', I wrote the following Java file, Hello.java:
class Hello { public static void main(String[] a) { System.out.println("Hello world!"); } }
Here is what I did in a command window to compile Hello.java into Hello.class:
herong> javac Hello.java herong> dir Hello.* 416 Hello.class 116 Hello.java herong> java Hello Hello world!
As you can see, launching a simple Java application is easy - Run the 'java' command without any options followed by the class name.
Table of Contents
javac - The Java Program Compiler
►java - The Java Program Launcher
java - Program Launching Command and Options
►Launching Hello.java - My First Java Program
"java -classpath" - Specifying Class Path
"java -jar" - Specifying Executable JAR File
"java -X" - Specifying Non-Standard Options
"java --list-modules" - Listing Modules in JDK
"java --describe-module" - Printing Module Definition
"java --module" - Launching Program from Module
"java --module" - Launching Program from Module JAR
javaw - Launching Java Programs without Console
jpackage - Binary Package Builder
javadoc - The Java Document Generator
jdeps - The Java Class Dependency Analyzer
jdeprscan - The Java Deprecated API Scanner
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
jhsdb - The Java HotSpot Debugger
jvisualvm (Java VisualVM) - JVM Visual Tool
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jrunscript - Script Code Shell
native2ascii - Native-to-ASCII Encoding Converter