jre interprets (executes) Java bytecodes.
jre [ options ] classname <args> jrew [ options ] classname <args>
The jre command executes Javaclass
files. The jrew command is identical to jre, except that with jrew there is no associated console window. Use jrew when you don't want a command prompt window to appear.The
classname
argument is the name of the class file to be executed. Any arguments to be passed to the class must be placed after theclassname
on the command line. On Windows platforms, the jre tool ignores the CLASSPATH environment variable. The-cp
option should be used to specify an application's class path.
By default, each class file is compiled to native code by a Just In Time bytecode compiler, or JIT. Using the JIT can cause some delay in program startup and class file loading, but can also reduce overall program execution time by a factor of ten.
On Windows, jre ignores the environment variable JAVA_COMPILER. To disable the JIT, use the
-nojit
option. To use an alternate JIT, use the-D
option to set thejava.compiler
property. The launcher appends.DLL
to the property value, then searches for the resulting filename. The search begins in the executable directory (the same directory that containsJRE.EXE
), and continues with all directories in thePATH
. For example:jre -Djava.compiler=myjit MyClass
zip
or jar
file, the path to that file must end with the file's
name. Here is an example of an argument for -classpath consisting
of two paths:
C:\xyz\classes;C:\usr\local\java\classes\MyClasses.jar
jar
file, the path to that file must end with the file's name.
Here is an example of an argument for -cp consisting of two paths:
C:\xyz\classes;C:\usr\local\java\classes\MyClasses.jar
By default, x is measured in bytes. You can specify x in either kilobytes or megabytes by appending the letter "k" for kilobytes or the letter "m" for megabytes.
By default, x is measured in bytes. You can specify x in either kilobytes or megabytes by appending the letter "k" for kilobytes or the letter "m" for megabytes.
-ss
option sets the maximum stack size that can be used by
C code
in a thread to x. Every thread that is spawned during the execution of
the program passed to jre has x as its C stack size. The
default
units for x are bytes. The value of x must be greater
than or equal to 1000 bytes.
You can modify the meaning of x by appending either the letter "k" for kilobytes or the letter "m" for megabytes. The default stack size is 128 kilobytes ("-ss128k").
-oss
option sets the maximum stack size that can be used by
Java code
in a thread to x. Every thread that is spawned during the execution of
the program passed to jre has x as its Java stack size. The
default
units for x are bytes. The value of x must be greater
than or equal to 1000 bytes.
You can modify the meaning of x by appending either the letter "k" for kilobytes or the letter "m" for megabytes. The default stack size is 400 kilobytes ("-oss400k").
% jre -Dawt.button.color=green ...sets the value of the property awt.button.color to "green". jre accepts any number of -D options on the command line.
java