13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.9 What You Still D<strong>on</strong>’t Know187obfuscati<strong>on</strong> as other native compiled code. If you need to make your codeclosed and proprietary, gcj may be the right tool for you. Naturally, we aren’tvery f<strong>on</strong>d of this idea, but it is still a reas<strong>on</strong> <strong>on</strong>e might choose the tool.Finally, we menti<strong>on</strong>ed that speed wasn’t a certain factor for choosing gcj,but there is an excepti<strong>on</strong>. So far, 15 Java is particularly slow at starting andshutting down virtual machines. If you have a Java program that is invoked <strong>on</strong>demand or in a loop and the VM is started and stopped <strong>on</strong> each invocati<strong>on</strong>,then gcj will give you a huge speed improvement, even if the code executes atthe same speed or slightly slower than the JIT JVM code.7.7REASONS NOT TO USE GCJWe can think of three reas<strong>on</strong>s not to use gcj. First, the compiled binary willrun <strong>on</strong>ly <strong>on</strong> the target platform, whereas a Java bytecode binary is portable toany Java runtime without modificati<strong>on</strong> or recompilati<strong>on</strong>. Sec<strong>on</strong>d, gcj is notdefinitive. Sun still “owns” Java and <strong>on</strong>ly Sun’s implementati<strong>on</strong> can be presumedto be “correct.” Third, the gcj API classes are not complete. If you visitthe API status page we menti<strong>on</strong>ed earlier, you can see what is provided andwhat is not. If gcj lacks an API your applicati<strong>on</strong> requires, then you can be suregcj is not the tool for you.7.8REVIEWThe GNU Compiler for Java is part of the GNU Compiler Collecti<strong>on</strong>. It isgenerally used to compile Java source code into native binaries. It providesmany of Sun’s API classes, but not all.7.9WHAT YOU STILL DON’T KNOWYou do not know how to interface with C/C++ code using gcj. You do notknow how to use SWT from Eclipse to write GUI apps with gcj.15. Sun claims that Java 5.0 will show c<strong>on</strong>siderable improvement in VM initializati<strong>on</strong> speed.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!