java
Java application launcher and runtime
TLDR
Run class file
SYNOPSIS
java [options] class [args...]
java [options] -jar jarfile [args...]
DESCRIPTION
java launches Java applications by loading and executing compiled bytecode in the Java Virtual Machine (JVM). It can run individual class files, JAR archives, or since Java 11, single source files directly.
The runtime handles memory management through garbage collection, threading, and platform abstraction. JVM options control heap size, garbage collector behavior, and system properties. The classpath mechanism locates dependencies, while the module path (Java 9+) provides stronger encapsulation.
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.
CONFIGURATION
JAVA_HOME
Environment variable pointing to the JDK installation directory.CLASSPATH
Environment variable specifying default class search paths.JAVA_TOOL_OPTIONS
Environment variable for default JVM options applied to all Java invocations._JAVA_OPTIONS
Environment variable for JVM options (vendor-specific, overrides JAVATOOLOPTIONS).
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.
