ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karin Lagesen <>
Subject build.xml jar target problem
Date Tue, 08 Jul 2003 10:44:12 GMT
I am sorry if the problem I am having is not an ant problem, but I
thought I'd try here anyway...:)

I use ant to make my manifest file when making jar files. The produced
manifest file seems ok, I cannot run the jar file.

Manifest file produced:

Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Built-By: karinlag
Main-Class: no.uio.labmed.InterGene

The error I get when I try to run the jar file:

uracil:10:39> java -jar dist/jar/InterGene.20030708.jar
Exception in thread "main" java.lang.NoClassDefFoundError:

My build file (sorry if this message gets large...)

<?xml version="1.0" encoding="iso-8859-1"?>
<project name="InterGene" default="build">

  <!-- URL to Java 2 API documentation --> 
  <property name="apiurl" value=""/> 

  <!-- Directories -->
  <property name="src"          value="${basedir}/src"/>     <!-- Source -->
  <property name="lib"          value="${basedir}/lib"/>     <!-- External packages/jar
files -->
  <property name="build"        value="${basedir}/build"/>   <!-- Build directory
  <property name="classes"      value="${build}/classes"/>   <!-- Compiled source
files -->
  <property name="doc"          value="${basedir}/doc"/>     <!-- Documentation -->
  <property name="javadoc"      value="${doc}/javadoc"/>     <!-- Javadoc documentation
  <property name="dist"         value="${basedir}/dist"/>    <!-- Distro = jar, source
and doc -->
  <property name="jar"          value="${dist}/jar"/>        <!-- Jar file directory

  <!-- Initialization -->
  <target name="init">
    <mkdir dir="${build}"/>
    <mkdir dir="${classes}"/>
    <mkdir dir="${doc}"/>
    <mkdir dir="${javadoc}"/>
    <mkdir dir="${dist}"/>
    <mkdir dir="${jar}"/>

  <!-- Copy icons -->
  <target name="icons" depends="init">
    <copy todir="${build}/icons">
      <fileset dir="${basedir}" includes="icons/*.gif"/>
  <!-- Build all classes -->
  <target name="build" depends="init,icons">
     <javac srcdir="${src}" destdir="${classes}"/>

  <!-- Build documentation -->
  <target name="javadoc" depends="init">
    <javadoc sourcepath="${src}" destdir="${javadoc}"
      <link href="${apiurl}"/>

  <!-- Build jar file -->
  <target name="jar" depends="init,icons,build">
    <jar jarfile="${jar}/${}.${DSTAMP}.jar">
        <attribute name="Built-By" value="${}"/>
        <attribute name="Main-Class" value="no.uio.labmed.InterGene"/>
      <fileset dir="${build}" includes="**/*.class"/>
      <fileset dir="${build}" includes="**/*.gif"/>

  <!-- Build distro -->
  <target name="dist" depends="init,icons,build,javadoc,jar">
    <copy todir="${dist}/javadoc">
      <fileset dir="${javadoc}" includes="**/*"/>

  <!-- Clean up -->
  <target name="clean">
    <delete dir="${build}"/>
    <delete dir="${doc}"/>
    <delete dir="${dist}"/>


Karin Lagesen, PhD student

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message