Java Reference
In-Depth Information
obfuscation as other native compiled code. If you need to make your code
closed and proprietary, gcj may be the right tool for you. Naturally, we aren't
very fond of this idea, but it is still a reason one might choose the tool.
Finally, we mentioned that speed wasn't a certain factor for choosing gcj ,
but there is an exception. So far, 15 Java is particularly slow at starting and
shutting down virtual machines. If you have a Java program that is invoked on
demand or in a loop and the VM is started and stopped on each invocation,
then gcj will give you a huge speed improvement, even if the code executes at
the same speed or slightly slower than the JIT JVM code.
7.7
R EASONS N OT TO U SE GCJ
We can think of three reasons not to use gcj . First, the compiled binary will
run only on the target platform, whereas a Java bytecode binary is portable to
any Java runtime without modification or recompilation. Second, gcj is not
definitive. Sun still “owns” Java and only Sun's implementation can be pre-
sumed to be “correct.” Third, the gcj API classes are not complete. If you visit
the API status page we mentioned earlier, you can see what is provided and
what is not. If gcj lacks an API your application requires, then you can be sure
gcj is not the tool for you.
7.8
R EVIEW
The GNU Compiler for Java is part of the GNU Compiler Collection. It is
generally used to compile Java source code into native binaries. It provides
many of Sun's API classes, but not all.
7.9
W HAT Y OU S TILL D ON ' T K NOW
You do not know how to interface with C/C++ code using gcj . You do not
know how to use SWT from Eclipse to write GUI apps with gcj .
15. Sun claims that Java 5.0 will show considerable improvement in VM initialization speed.
Search WWH ::




Custom Search