Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can I use ant to run a java application?

Answer Posted / Rahul Sharma

To run a Java application using Ant, create a target in your build.xml file that runs the `java` task with the main class and any required arguments. Here's an example:

```xml
<project name="My Project" default="run">
<target name="run">
<java fork="yes" classname="com.mypackage.MainClass">
<arg value="-Dargument1=value1"/>
<arg value="-Dargument2=value2"/>
<!-- additional arguments go here -->
</java>
</target>
</project>
```
In this example, the `run` target forks the JVM and runs the MainClass located in com.mypackage with specified command-line arguments.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category