Solved

Using Ant to build a jar

Posted on 2007-11-29
3
924 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
 

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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 …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.

691 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