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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.5 Opti<strong>on</strong>s and Switches1857.5OPTIONS AND SWITCHESAs we have said, gcj is part of the gcc suite of compilers and therefore supportsall of the n<strong>on</strong>-language-specific opti<strong>on</strong>s and switches of that suite.As with most reference material in this book, we will <strong>on</strong>ly cover thehighlights. See the gcj manpage or the project’s Web site for full details. 14-IdirnameAdd dirname to the classpath ahead of its existing c<strong>on</strong>tents.-Dname[=value]Add name and opti<strong>on</strong>al value to the system properties list. This is <strong>on</strong>lyvalid with the --main switch.--mainSpecifies which class c<strong>on</strong>tains the applicati<strong>on</strong>’s main(). This gives thestarting point for an applicati<strong>on</strong>.-fno-bounds-checkDisable array bounds checking. Like “real” Java, gcj checks all array operati<strong>on</strong>sto ensure that array bounds are not exceeded. Using this switchdisables that check. It speeds up array operati<strong>on</strong>s but can introduce subtleand hard-to-find bugs. Use at your own risk.-fno-store-checkLike -fno-bounds-check, this disables a safety feature <strong>on</strong> arrays. Normally,when you store an object into an array, a check is made to make surethat the object is assignment-compatible with the array type (in otherwords, that the object is an instanceof() of the array type). Using thisswitch disables this test. It speeds up array operati<strong>on</strong>s but can introducesubtle and hard-to-find bugs. Use at your own risk.There are other switches for native methods, bytecode (as opposed t<strong>on</strong>ative) compilati<strong>on</strong>, and some switches related to resources. We leave it as anexercise for the reader to learn and use these where needed.14. http://gcc.gnu.org/java/

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

Saved successfully!

Ooh no, something went wrong!