Chapter 5. Compilation and Execution Services

Using Custom Compilation and Execution Services

The IDE uses Compilation and Execution services to compile and run Java programs. During setup, the IDE locates your Java Standard Development Kit (SDK) and sets up a Compilation service called the Internal Compilation Service that uses the standard javac tool as a compiler. You can customize this compiler from the IDE’s Options dialog. In some cases, however, this compiler may not be desirable. In such cases, the IDE allows you to add your own Java compiler as an External Compilation Service. A good example of needing an External Compilation Service would be for compiling Java source code written for the Java 1.1 SDK or for using a third-party vendor’s highly optimized compiler. Like Compilation services, Execution services are highly customizable in the IDE. Execution services use the Java interpreter to execute compiled classes in a given JVM. The current JVM is used by the Internal Execution Service, whereas additional JVMs can be configured using the External Execution Service (you can also have multiple configurations of the Internal Execution Service).

Creating and Customizing Internal Compilation Services

After installation, the IDE will configure a single default Internal Compilation Service. To configure the default Internal Compilation Service, select Tools Options. In the Options window that appears, expand the nodes Building Compiler Types. Select the Internal Compilation ...

Get NetBeans: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.