Installed JREs
RAD v7.5 allows you to specify which Java Runtime Environment (JRE) should be used by the Java builder. By default, the standard Java VM that comes with the product is used; however, to ensure that your application is targeted for the correct platform, the same JRE or at least the same version of the JRE should be used to compile the code. If the application is targeted for a WebSphere Application Server V6.1, then the JRE should be set to use the JRE associated with this environment in RAD v7.5.
To configure the installed JREs, select Windows Æ Preferences Æ Java Æ Installed JREs.
Figure 3-36 Java: Installed JRE preferences
Note: Changing the JRE used for running does not affect the way Java source is compiled. You can adjust the build path to compile against custom libraries.
|
By default, the JRE used to run the Workbench will be used to build and run Java programs. It appears selected in the list of installed JREs. If the target JRE that the application will run under is not in the list of JREs, then this can be installed on the machine and added onto the list. You can add, edit, or remove a JRE.
Let us assume that the application you are writing requires the latest JRE 1.6 located in the directory C:\Program Files\Java\jre1.6\. The procedure to add a new JRE is as follows:
| Click Add.
|
| In the Add JRE dialog, enter the following items:
|
JRE type: A drop-down box indicating whether a Standard VM or Standard 1.1.x VM. In most circumstances this will be set to Standard VM.
|
JRE name: Any name for the JRE to identify it.
|
JRE home directory: The location of the root directory of the install for the JRE: C:\Program Files\Java\jre1.6\
|
Default VM arguments: Arguments that are required to be passed to the JRE.
|
JRE system libraries: List of Jar files required for the JRE. Add Jar files under the C:\Program Files\Java\jre1.6\lib and C:\Program | iles\Java\jre1.6\lib\ext directories.
|
| Click OK to add.
|
| Select the JRE in the list of installed JREs to set it as the default JRE, click OK, and rebuild all the projects in the workspace.
|