?
Solved

Using Ant to build a jar

Posted on 2007-11-29
3
Medium Priority
?
925 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 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

777 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