Launch Configurations
How do you specify command-line parameters to your program or change the Java VM options that are used to invoke your program? Every time you select Run As → Java Application on a new class that has a main() method, Eclipse creates a launch configuration for you. A launch configuration is the set of all the options used to run your program.
To change those options, select Run → Run…and locate your configuration in the dialog. Click on the configuration to see all the options in a series of tabbed pages on the right-hand side of the window (the tabs are described in Table 8). You can also create new configurations in this dialog.
Table 6-3. Launch configuration tabs
|
Tab name |
Description |
|---|---|
|
Main |
Specify the project and the name of the Main class. |
|
Arguments |
Set the program arguments, the Java VM arguments, and the working directory in which to start the program. |
|
JRE |
Specify the version of Java used to run the program (this can be different than the one used to compile it). |
|
Classpath |
Set the list of JARs and classes available at runtime. |
|
Source |
Locate the source code inside or outside the workspace. |
|
Environment |
Pass environment variables to the program. |
|
Common |
Miscellaneous options. |
Many more features of Eclipse are waiting to be discovered, and new ones are added in each release. The "Tips and Tricks" section of the online help (Help → Tips and Tricks) is a good place to look for the kinds of little nuggets that can save you time or let you do something ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access