> java -version java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) > java -showversion (edited) java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) Usage: to execute a class) java [options] <mainclass> [args...] to execute a jar file) java [options] -jar <jarfile> [args...] to execute the main class in a module) java [options] -m <module>[/<mainclass>] [args...] java [options] --module <module>[/<mainclass>] [args...] Arguments following the main class, -jar <jarfile>, -m or --module <module>/<mainclass> are passed as the arguments to main class. where options include: --list-modules list observable modules and exit --dry-run create VM and load main class but do not execute main method. The --dry-run option may be useful for validating the command-line options such as the module system configuration. --validate-modules validate all modules and exit useful for finding conflicts and other errors with modules on the module path. -classpath <class search path of directories and zip/jar files> -cp <class search pathsic of directories and zip/jar files> --class-path <class search path of directories and zip/jar files> separated list of directories, JAR archives, and ZIP archives to search for class files. -p <module path> --module-path <module path>... separated list of directories, each directory is a directory of modules. --upgrade-module-path <module path>... separated list of directories, each directory is a directory of modules that replace upgradeable modules in the runtime image --add-modules <module name>[,<module name>...] root modules to resolve in addition to the initial module. <module name> can also be ALL-DEFAULT, ALL-SYSTEM, ALL-MODULE-PATH. -d <module name> --describe-module <module name> describe a module and exit -D<name>=<value> set a system property -verbose:[class|module|gc|jni] enable verbose output -version output product version to the error stream and exit --version output product version to the output stream and exit -showversion output product version to the error stream and continue --show-version output product version to the output stream and continue --show-module-resolution show module resolution output during startup -? -h -help output this help message to the error stream --help output this help message to the output stream -X output help on extra options to the error stream --help-extra output help on extra options to the output stream -ea[:<packagename>...|:<classname>] -enableassertions[:<packagename>...|:<classname>] enable assertions with specified granularity -da[:<packagename>...|:<classname>] -disableassertions[:<packagename>...|:<classname>] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:<libname>[=<options>] load native agent library <libname>, e.g. -agentlib:jdwp see also -agentlib:jdwp=help -agentpath:<pathname>[=<options>] load native agent library by full pathname -javaagent:<jarpath>[=<options>] load Java programming language agent, see java.lang.instrument -splash:<imagepath> show splash screen with specified image HiDPI scaled images are automatically supported and used if available. The unscaled image filename, e.g. image.ext, should always be passed as the argument to the -splash option. The most appropriate scaled image provided will be picked up automatically. See the SplashScreen API documentation for more information @argument files one or more argument files containing options -disable-@files prevent further argument file expansion To specify an argument for a long option, you can use --<name>=<value> or --<name> <value>.+++
The Java Runtime (JRE) from java.com or oracle.com contains a plugin to run Java content from your browser.
To use the command line tools, download the Java Development Kit (JDK). The JRE and JDK are separate and can coexist. Only one JRE can be installed on Mac OS X. There can be multiple JDKs installed on a system, as many as you wish.
Determining the Default Version of the JDK
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
Using the Command-line to find Java Versions - Mac OS X
(From https://java.com/en/download/help/version_manual.xml#cmdline
java -version
If this starts java but then fails ls -la /usr/lib/jvm
.
When launching a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different than the version of the JDK.(like when developing for another version)
F:\j2sdk1.4.1_01\docs\api
java
- the sun Java application launcher Usage: To execute a class: java [-options] class [args...] # (from bin java com/domain/MainClassfile (no .class) ) To execute a jar file: java [-options] -jar jarfile [args...] -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the "server" VM The default VM is server, because you are running on a server-class machine. -cp-classpath separated list of directories, JAR archives, and ZIP archives to search for class files. -D = set a system property -verbose:[class|gc|jni] enable VERY verbose output (gc garbage colllectin ?) -version: require the specified version to run -version -showversion -jre-restrict-search | -no-jre-restrict-search include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[: ...|: ] -esa | -enablesystemassertions -enableassertions[: ...|: ] -dsa | -disablesystemassertions -disableassertions[: ...|: ] -da[: ...|: ] -agentlib: [= ] load native agent library , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath: [= ] load native agent library by full pathname -javaagent: [= ] load Java programming language agent, see java.lang.instrument -splash: See Oracle JavaSE docs for more details.