Home
Java classpath variables
RAD v7.5 provides a number of default classpath variables that can be used in a Java build path to avoid a direct reference to the local file system in a project. This method ensures that the project only references classpaths using the variable names and not specific local file system directories or paths. This is a good programming methodology when developing within a team and using multiple projects using the same variables. It means that all team members have to set the variables required for a project, and this data is maintained in the workspace.
Tip: We recommend that you standardize the Application Developer installation path for your development team. Many files within the projects have absolute paths based on the Application Developer installation path, thus when you import projects from a team repository such as CVS or ClearCase, you will get errors even when using classpath variables.
Depending on the type of Java coding you plan to do, you might have to add variables pointing to other code libraries. For example, this can be driver classes to access relational databases or locally developed code that you want to reuse in other projects. After you have created a Java project, you can add any of these variables to the project's classpath.
To configure the default classpath variables, do these steps:
Select Window Æ Preferences Æ Java Æ Build Path Æ Classpath Variables. A list of the existing classpath variables is displayed.
Figure 3-19 Classpath variables preferences
Creation, editing, or removing of variables can be performed in this screen. Click New to add a new variable.
In the New Variable Entry dialog, enter the name of the variable and browse for the path and click OK.
Figure 3-20 New Variable Entry dialog
Certain class path variables are set internally and cannot be changed in the Classpath variables preferences:
JRE_LIB: The archive with the runtime JAR file for the currently used JRE
JRE_SRC: The source archive for the currently used JRE
JRE_SRCROOT: The root path in the source archive for the currently used JRE
ibm.com/redbooks