String Substitution Preferences

The following preferences can be set using the Opens the String Substitution preference page Run/Debug > String Substitution preference page.

This preference page is used solely for the purpose of creating string variables to be reused in other locations that accept string variable substitution.

The platform SDK for Eclipse uses string variables in the launch dialog for setting program and VM arguments for certain types of launch configurations, as well as allowing substitutions for Ant targets in the External Tools launch dialog. Consider the following screen shot which shows the String Substitution preference page with a new TEST string variable created.

String Substitution Page With Example TEST Variable

In this case the TEST variable does nothing, but in the 'real' world it could point to a directory or program that you would like to reuse the path for in configurations, etc.

If we now want to leverage this new variable, we can do so from the launch dialog on the arguments tab (for those configurations that have a standard arguments tab), by selecting the Variables... button for either the program or VM arguments text area. Selecting the Variables button opens a dialog with a listing of all of the string variables available.

In the following screen shot we can see the TEST variable available in the list.

String Variable Selection Dialog

We can now select the TEST variable and insert in as an argument if we wish, as shown in the following screen shot.

Launch Dialog With Substituted String

The other mentioned platform use of string substitution in the External Tools launch dialog, used with Ant configurations, as shown in the following screen shot.

Ant Configuration Using String Substitution

Related concepts

Debugger
Java perspectives
Java views
Local debugging
Remote debugging

Related tasks

Launching a Java program
Running and debugging

Related reference

Console Preferences
Installed JREs Preferences
Java Debug Preferences
Launching Preferences
Perspectives Preferences
Run/Debug Preferences
View Management Preferences