Exercise 1.1: Importing the required resource
Before you begin this tutorial, you must import the following file:
This program implements a random number simulation. The program writes to the console using System.out.println. Your probe will also write to the console. This will allow you to see how the probe interacts with the program.
Importing the RandomNumbers.java file involves two steps:
- Creating a project named RandomNumbers
- Importing the RandomNumbers.java file into the project
To create the project:
- If the Welcome view is open, click X in the view's tab to close the view. (You can restore the Welcome view at any time by clicking Help > Welcome.)
- From the Software Development Platform menu bar, click Project to display the Project menu. Make sure that Build Automatically is checked.
- Click Window > Open Perspective > Java. The Java perspective opens.
- Click File > New > Project. The New Project dialog box opens.
- In the Wizards list, expand the Java entry, select Java Project, and click Next. The New Java Project dialog box opens.
- In the Project name field, type RandomNumbers, then click Finish.
To import the RandomNumbers.java file:
- In the Package Explorer, right-click RandomNumbers, then click Import. The Import dialog box opens.
- Under Select an import source, select File system and click Next. The dialog box changes to allow you to import a file system.
- Next to From directory, click Browse. The "Import from directory" dialog box opens.
- Navigate to the following directory: <installdir>/rad/eclipse/plugins/com.ibm.rational.pd.probe.tutorial.doc_<latestVersion>, where <installdir> is the directory where your Software Development Platform application is installed.
- Select resources, then click OK.
- In the Import dialog box, click the check box next to the RandomNumbers.java entry. A check mark appears in the check boxes next to resources and RandomNumbers.java.
- In the Import dialog box, click Finish. An entry for RandomNumbers is added in the Package Explorer view.
Now you are ready to begin Exercise 1.2: Creating your first probe.