There are several settings that you have to configure if you want to write, compile, execute, and debug code that is not designed for the IDE's default JDK version.
If you are writing code that contains assertions for version 1.4 of the J2SE platform, make sure the Java parser is set to recognize assertions. You can change this setting by selecting the Java Sources node in the Options window and setting the Enable JDK 1.4 Source property accordingly. See Working With Assertions for more information.
You can set a compiler type to compile for a specific JDK version by using that Java platform's javac compiler. To do so, select the compiler type in the Options window. Then use the compiler type's External Compiler property to navigate to the compiler executable.
You can also set a compiler type to use the default Java platform's javac but compile against a different Java platform's libraries. To do so, make a copy of the External Compiler and point its Boot Class Path property to the target Java platform's libraries. See Cross-Compiling Between Java Platforms for more information.
If you are writing code that contains assertions, you must also set the compiler type's Enable JDK 1.4 Source property to True. Any code compiled by this compiler type will then be runnable only on JDK version 1.4.
You can set any execution type except Internal Execution to execute a program with a different JDK version. To do so, select the execution type in the Options window and click the ellipsis (...) in the External Process property. Then click the ellipsis in the Process field to navigate to the target Java platform's java executable.
If you want to enable assertion checking for your code, set the execution type's Enable Asserts property to True.
You can change the target JDK version for a debugger type by changing the debugger executable that the debugger type uses. To do so, select the debugger type in the Options window and click the ellipsis (...) in the External Process property. Then click the ellipsis in the Process field to navigate to the target Java platform's debugger executable.
You can also use the default JDK version's debugger to debug against a different Java platform. To do so, select the debugger type and set the Boot Class Path to the target Java platform's libraries.
If your code contains assertions, you also have to set the Enable Asserts property True.
See Also | |
---|---|
Execution Types in the IDE Compiler Types in the IDE Debugger Types in the IDE Configuring Java Settings Switching JDK Versions Working With Assertions Cross-Compiling Between Java Platforms |