Next: Configure-time Options, Previous: Warnings, Up: Invoking gcj
In addition to the many gcc options controlling code generation, gcj has several options specific to itself.
--main=
CLASSNAMEmain
method should be invoked when the resulting executable is
run. 1
-D
name[=
value]
--main
. It defines a system
property named name with value value. If value is not
specified then it defaults to the empty string. These system properties
are initialized at the program's startup and can be retrieved at runtime
using the java.lang.System.getProperty
method.
-C
--resource
resource-nameResourceBundle.getBundle
.
The actual file name to be compiled this way must be specified
separately.
-d
directory-C
, this causes all generated .class files
to be put in the appropriate subdirectory of directory. By
default they will be put in subdirectories of the current working
directory.
-fno-bounds-check
ArrayIndexOutOfBoundsException
.
-fno-store-check
ArrayStoreException
.
-fjni
-fjni
. This option causes
gcj to generate stubs which will invoke the underlying JNI
methods.
-fno-assert
assert
keyword. This is for compatibility
with older versions of the language specification.
-fno-optimize-static-class-initialization
-O2
,
gcj will try to optimize the way calls into the runtime are made
to initialize static classes upon their first use (this optimization
isn't carried out if -C
was specified.) When compiling to native
code, -fno-optimize-static-class-initialization
will turn this
optimization off, regardless of the optimization level in use.
[1] The linker by default looks for a global function named
main
. Since Java does not have global functions, and a
collection of Java classes may have more than one class with a
main
method, you need to let the linker know which of those
main
methods it should invoke when starting the application.