DGG's Java notes

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.

Using the Command-line to find Java Versions - Mac OS X (From https://java.com/en/download/help/version_manual.xml#cmdline
Type the following in a Terminal window:
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

Determining the Default Version of the JDK

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)



java - the sun Java application launcher

Usage: java [-options] class [args...]
           (to execute a class)            (from bin  java com/domain/MainClassfile   (no .class) )

   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

    -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.  

                  A : 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
    -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

    -esa | -enablesystemassertions     

    -dsa | -disablesystemassertions

                  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
See Oracle JavaSE docs for more details.