Solved

Using Ant to build a jar

Posted on 2007-11-29
3
919 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 77
Running Jira on Raspberry PI 2? 3 261
Java / Linux and Regular Expressions 11 70
How to convert String matching to regex in java 4 21
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now