Java Reference
In-Depth Information
Even if this were not so, it is not permissible under the GPL to distribute
binaries without also offering to distribute source code. So, to distribute the
Sun or IBM API JAR files would be incompatible with the GPL, and to not
distribute them but to depend on them would mean shipping a product that
doesn't work out of the box and requires users to obtain some non-Free soft-
ware in order to work. That is just not acceptable. So the developers of gcj have
opted to reimplement as much of the Java APIs as possible.
As you can probably guess if you have browsed the Java API Javadoc files,
this is a monumental undertaking. The Java APIs are a moving target, and they
started huge and grow larger with every new release. There is a parallel project
to gcj called GNU Classpath 8 which is attempting to implement the entire Java
API. Its target for the 1.0 release is to be fully compatible with Java 1.1 and
“largely compatible” with Java 1.2. You might want to look at that project for
better API support than that provided by gcj 's libgcj . 9 If you are curious
about the present status of libgcj 's implementation of the Java APIs, there is
a Web page (frequently updated) that compares the status of it against the
Java 1.4 packages. 10
7.4.1
We'll discuss gcj 's command-line switches in detail in Section 7.5, but we will
have to use a couple of them here. First off, be aware that since gcj is actually
part of gcc , all of the non-language-specific switches of that system also work
in gcj ; thus, -o specifies the name of the binary output file, and so on. There
are many references on gcc to which you should refer for details (the manpage
on gcc is a good place to start). Example 7.1 shows compiling and running
FetchURL with gcj .
Compiling FetchURL with gcj
8. http://www.gnu.org/software/classpath/
9. The gcj and GNU Classpath projects are in the middle of an effort to merge their libraries
into a common library. The GNU Classpath project aims to be a Free Software replacement
for the JRE API JAR file. As such, it is meant to be a library of Java bytecodes that may be used
as a drop-in replacement in any Java runtime environment. For our discussion, we will assume
you are using libgcj as shipped with gcj itself.
10. http://gcc.gnu.org/java/jdk14-libgcj.html
Search WWH ::




Custom Search