Solved

Using Ant to build a jar

Posted on 2007-11-29
3
922 Views
Last Modified: 2013-11-23
Experts,

I am trying to use Ant to build a jar file for the first time.  I have 10 classes in a directory C:\views\rafterco_view2\bin\com\hsbc\cds\cdstomarkit\markit\filegen on my local machine.  
I also have jars stored here: C:\views\rafterco_view2\gm_pads\imp\src\External that are required for the build.

What is the minimum I need in my build.xml to create this jar file?

Thanks,
Margin_Walker
0
Comment
Question by:Margin_Walker
3 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 20373006

You need to know the basics of using ant (just how to make a simple basic build file). Read this:

http://ant.apache.org/manual/

Then you have to use javac task, here is the documentation:

http://ant.apache.org/manual/CoreTasks/javac.html
0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20374010
0
 

Accepted Solution

by:
ikarius earned 125 total points
ID: 20382512
Try this (minimal though):

<?xml version="1.0" encoding="UTF-8"?>
<project name="name of project" default="package">

      <property name="src" location="location_of_sources" />
      <property name="dist" location="location_of_the_jar_to_produce" />
        <property name="jarname" location="name_of_jar" />

      <target name="package">
        <jar destfile="${dist}/${jarname}.jar"  basedir="${src}/>
      </target>

</project>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question