What's New in Oracle® Solaris Studio 12.4

Exit Print View

Updated: December 2014
 
 

New Launchers Feature in IDE

You can create "launchers" so you can easily run your project from the project context menu with different arguments, for example, or launch it from a script. Normally when you run your application from the IDE, the executable specified in the project properties as the Run command is executed. If you create launchers, you can specify multiple commands to run, and then select them from the context menu. You can use the launchers for debugging also.

To create launchers, go to your nbproject/private folder and customize the Launchers File (launchers.properties).

In the New Launchers File dialog, select the option File Privacy if you want to store the definition of the launchers in the nbproject/private subfolder of the project. This option is useful if the project is shared with other developers, especially in a version control system. You can ignore the nbproject/private in the VCS so it is not included when you share the project. If a private launchers file exists, the launchers in the private file will override launchers of the same name in the public launcher file.

Click Finish, and a launchers.properties text file opens in the IDE editor. You can specify commands to run and display names to show in the IDE for running those commands. As an example, for the IDE's C/C++ sample application called Arguments, you could add the following to your launchers.properties file:

launcher1.runCommand="${OUTPUT_PATH}" "arg 1" "arg 2" "arg 3" "arg 4"
launcher1.displayName=Four Args

launcher2.runCommand=../dist/Debug/OracleSolarisStudio-Solaris-x86/arguments_1 "arg 1"
launcher2.displayName=One Arg

launcher3.runCommand=/bin/sh runMyProgram.sh

The file runMyProgram.sh might be a script that sets environment variables for example, or does anything you want.

If you want to debug your application using a launcher that runs a script, you must also specify the option symbolFiles for that launcher so the debugger can debug the application instead of the shell used to run the script. For the launcher3 example above, this option could be added as follows:

launcher3.runCommand=/bin/sh runMyProgram.sh
launcher3.symbolFiles=${LINKER_OUTPUT}

When you are finished adding launcher options, save the launcher.properties file.

Then you can run these commands by right-clicking the project and selecting one of them. In the example above, you would right-click, select the Run As command and select the name of the command. For example, Run As > Four Args or Debug As > /bin/sh runMyProgram.sh.