Home

 

Preparing for the sample

To demonstrate the basic concepts of Ant, we provide a very simple Java application named HelloAnt, which prints a message to the console. We use a simple Java project ( RAD75Ant) and class (HelloAnt) for this example.

To create a new Java project, do these steps:

In the Workbench, select File Æ New Æ Project.

In the New Project dialog, select Java Æ Java Project and click Next.

When prompted for the project name, enter RAD75Ant for the project name field, and click Finish.

If the current perspective is not the Java perspective when you create the project RAD prompts you to switch to the Java perspective. Click Yes.

To import the HelloAnt class into the RAD75Ant Java project, do these steps:

Right-click the RAD75Ant project and select New Æ Package.

In the New Package dialog, type itso.rad75.ant.hello for the Name, and click Finish.

Right-click itso.rad75.ant.hello and select Import.

In the Import dialog, select General Æ File System, and click Next.

In the File System dialog, click Browse and select c:\7672code\ant\ as directory, select HelloAnt.java, and click Finish (Figure | 5-1).

Figure 25-1 Import a Java class

ibm.com/redbooks