Copyright (C) 2000-2012 |
Manpages GCJSection: GNU (1)Updated: 2002-04-08 Index Return to Main Contents NAMEgcj - Ahead-of-time compiler for the Java languageSYNOPSISgcj [-Idir...] [-d dir...][--classpath=path] [--CLASSPATH=path] [-foption...] [--encoding=name] [--main=classname] [-C] [-Wwarn...] [-Dname[=value]...] sourcefile... DESCRIPTIONAs "gcj" is just another front end to "gcc", it supports many of the same options as gcc. This manual only documents the options specific to "gcj".OPTIONSInput and output filesA "gcj" command is like a "gcc" command, in that it consists of a number of options and file names. The following kinds of input file names are supported:
You can specify more than one input file on the "gcj" command line, in which case they will all be compiled. If you specify a "-o FILENAME" option, all the input files will be compiled together, producing a single output file, named FILENAME. This is allowed even when using "-S" or "-c", but not when using "-C". (This is an extension beyond the what plain "gcc" allows.) (If more than one input file is specified, all must currently be ".java" files, though we hope to fix this.) Input Options"gcj" has options to control where it looks to find files it needs. For instance, "gcj" might need to load a class that is referenced by the file it has been asked to compile. Like other compilers for the Java language, "gcj" has a notion of a class path. There are several options and environment variables which can be used to manipulate the class path. When "gcj" looks for a given class, it searches the class path looking for matching .class or .java file. "gcj" comes with a built-in class path which points at the installed libgcj.jar, a file which contains all the standard classes.In the below, a directory or path component can refer either to an actual directory on the filesystem, or to a .zip or .jar file, which "gcj" will search as if it is a directory.
The final class path is constructed like so:
The classfile built by "gcj" for the class "java.lang.Object" (and placed in "libgcj.jar") contains a special zero length attribute "gnu.gcj.gcj-compiled". The compiler looks for this attribute when loading "java.lang.Object" and will report an error if it isn't found, unless it compiles to bytecode (the option "-fforce-classes-archive-check" can be used to overide this behavior in this particular case.)
EncodingsThe Java programming language uses Unicode throughout. In an effort to integrate well with other locales, "gcj" allows .java files to be written using almost any encoding. "gcj" knows how to convert these encodings into its internal encoding at compile time.You can use the "--encoding=NAME" option to specify an encoding (of a particular character set) to use for source files. If this is not specified, the default encoding comes from your current locale. If your host system has insufficient locale support, then "gcj" assumes the default encoding to be the UTF-8 encoding of Unicode. To implement "--encoding", "gcj" simply uses the host platform's "iconv" conversion routine. This means that in practice "gcj" is limited by the capabilities of the host platform. The names allowed for the argument "--encoding" vary from platform to platform (since they are not standardized anywhere). However, "gcj" implements the encoding named UTF-8 internally, so if you choose to use this for your source files you can be assured that it will work on every host. Warnings"gcj" implements several warnings. As with other generic "gcc" warnings, if an option of the form "-Wfoo" enables a warning, then "-Wno-foo" will disable it. Here we've chosen to document the form of the warning which will have an effect - the default being the opposite of what is listed.
Code GenerationIn addition to the many "gcc" options controlling code generation, "gcj" has several options specific to itself.
Configure-time OptionsSome "gcj" code generations options affect the resulting ABI, and so can only be meaningfully given when "libgcj", the runtime package, is configured. "libgcj" puts the appropriate options from this group into a spec file which is read by "gcj". These options are listed here for completeness; if you are using "libgcj" then you won't want to touch these options.
FOOTNOTES
SEE ALSOgcc(1), gcjh(1), gij(1), jv-scan(1), jcf-dump(1), and the Info entries for gcj and gcc.COPYRIGHTCopyright (C) 2001 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``GNU General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled ``GNU Free Documentation License''.
Index
This document was created by man2html, using the manual pages. Time: 11:33:11 GMT, March 28, 2024 |