java
launches Java applications
TLDR
Run class file
$ java [ClassName]
Run JAR file$ java -jar [application.jar]
Run with classpath$ java -cp [path/to/classes] [ClassName]
Set heap size$ java -Xmx[512m] -jar [app.jar]
Run with system property$ java -D[property=value] [ClassName]
Show version$ java -version
Run single source file$ java [Source.java]
SYNOPSIS
java [options] class [args...]
java [options] -jar jarfile [args...]
DESCRIPTION
java launches Java applications. It loads and executes compiled bytecode in the Java Virtual Machine.
The runtime handles memory management, threading, and platform abstraction. It supports both class files and JAR archives.
PARAMETERS
CLASS
Main class to execute.-jar FILE
Execute JAR file.-cp PATH
Class path for dependencies.-Xmx SIZE
Maximum heap size.-Xms SIZE
Initial heap size.-D PROP=VAL
Set system property.-version
Show version information.--help
Display help information.
CAVEATS
Requires JRE/JDK. Version compatibility matters. Memory settings may need tuning.
HISTORY
Java was created by James Gosling at Sun Microsystems in 1995. It's now maintained by Oracle and the OpenJDK community.

