![]() ![]() If you want the property to be able to hold more than one file (such as for the Compile File target), you can use the following, where the comma (,) is the separator between file names: ![]() specifies that runclass can hold only one file. This property must be set by the IDE before the target can be run. You can choose any unique name for this property. Runclass is the name of the property that holds the context. In this case, it is the name of file that you want to run. sets the context on which the Ant target is executed. maps the Run File command and the F9 shortcut to the run-selected-file target. Now let's take a look at the following lines to see how it works. The runclass property is a newly defined property that holds the file that you want to run and is referenced by the java task. First we will look at how to do this and then we will explain it in detail: You store this reference in the same place where you map the build target ( run-selected-file) to the IDE action. For example, the run-selected-file target above looks for the currently selected file in the runclass property. Once you have an Ant target for running the selected file, you have to get a reference to that file in the IDE and store it in a property. You can select multiple projects in the Projects window and run them at once by choosing Run > Run ( number of selected projects) Projects (F6) from the main IDE's menu.ฤก0.4.1.2 Getting a Reference to the Currently Selected File in the IDE If you are running a project often, you can set a project as the main project by choosing Run > Set Main Project from the main menu and selecting the project in the submenu or by right-clicking the project node in the Projects window and choosing Set as Main Project. For information on setting the classpath, see Section 10.5, "Setting the Runtime Classpath." Each project can contain only one main class. You can change this setting in the Run panel of the project's Project Properties dialog box. If you run a project for which you have not specified a main class, the IDE prompts you for the main class. If Compile on Save is not selected, the project is run using the project's build script. If you have the Compile on Save option selected in the Compiling section of the Project Properties window, the project is run directly from the build/classes directory of your project. When running an application, be aware of the following considerations: Select the project that you want to run in the Projects window. For information on setting the main class, see Section 10.6, "Setting the Main Class and Runtime Arguments." You can run the project or run any individual project that contains an executable class. With standard projects, you typically have one project that contains the application main class and several projects containing class libraries. ![]()
0 Comments
Leave a Reply. |