Solved

Using Ant to build a jar

Posted on 2007-11-29
3
918 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
Comment Utility

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
Comment Utility
0
 

Accepted Solution

by:
ikarius earned 125 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

743 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

13 Experts available now in Live!

Get 1:1 Help Now