ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "THUFIR HAWAT" <thufir.ha...@mail.com>
Subject RE: error: ...class definition existed..can no longer be found ?
Date Thu, 03 Feb 2005 19:01:57 GMT
Boy, that's a silly error on my part.  Monsters is a whole diff package, I must've mixed them
up.  Thanks for spotting this.  I've cc'ed the list, for the sake of the archives, yes?

-Thufir


----- Original Message -----
From: "Saket Joshi" <saket_joshi@persistent.co.in>
To: thufir.hawat@mail.com
Subject: RE: error: ...class definition existed..can no longer be found ?
Date: Thu, 3 Feb 2005 16:03:29 +0530

> 
> Thufir,
> 
> It looks like your TidyTest.java is in the package jtidy and not monsters.
> Therefore manifest should have atreides.jtidy.TidyTest, please check.
> 
> 
> Saket
> 
> 
> 
> 
> 
> -----Original Message-----
> From: THUFIR HAWAT [mailto:thufir.hawat@mail.com]
> Sent: Thursday, February 03, 2005 3:49 PM
> To: user@ant.apache.org
> Subject: AW: error: ...class definition existed..can no longer be found ?
> 
> Thank you, Jan,
> 
> here's my manifest, extracted from the jar:
> 
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.6.2
> Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.)
> Main-Class: atreides.monsters.TidyTest
> 
> shouldn't the Main-Class value do the trick, so that I don't need to include
> the classpath switch when running the .jar?
> 
> 
> Thanks,
> 
> Thufir
> 
> 
> 
> ///////////Jan wrote:
> Your buildfile is correct, but your call for start is not.
> While compiling you have included Tidy.jar (${includeJar}), but you havent
> when starting TidyTest.jar.
> 
> 1) add the classpath when starting via "java -jar" or
> 2) support a classpath entry for the manifest file of TidyTest.jar
> 
> 
> Jan
> 
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: THUFIR HAWAT [mailto:thufir.hawat@mail.com]
> > Gesendet am: Donnerstag, 3. Februar 2005 09:44
> > An: user@ant.apache.org
> > Betreff: error: ...class definition existed..can no longer be found ?
> >
> > Is the source of this error due to build.xml?
> >
> >
> >
> > ////////////build.xml////////////////
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <project name="jtidy test" default="package">
> >
> > 	<property name="destdir"
> > 	value="C:\java\classes\" />
> > 	<property name="sourcedir"
> > 	value="C:\java\sources\atreides\jtidy\" />
> > 	<property name="includeJar"
> > 	value="C:\java\sources\org\w3c\tidy\Tidy.jar" />
> > 	<property name="mainClass"
> > 	value="TidyTest" />
> >
> > 	<target name="clean">
> > 		<delete dir="${destdir}" />
> > 	</target>
> >
> > 	<target name="prepare" depends="clean">
> > 		<mkdir dir="${destdir}" />
> > 	</target>
> >
> > 	<target name="compile" depends="prepare">
> > 		<javac
> > 			srcdir="${sourcedir}"
> > 			destdir="${destdir}"
> > 			classpath="${includeJar}"
> > 		/>
> > 	</target>
> >
> >
> >
> >
> > 	<target name="manifest" depends="compile">
> > 		<manifest file="${destdir}/MANIFEST.MF">
> > 			<attribute name="Main-Class" 			value="atreides.monsters.${mainClass}" />
> > 		</manifest>
> > 	</target>
> >
> > 	<target name="package" depends="manifest">
> > 		<jar jarfile="${destdir}/${mainClass}.jar"
> > 		basedir="${destdir}"
> > 		manifest="${destdir}/MANIFEST.MF" />
> > 	</target>
> >
> > </project>
> >
> >
> >
> >
> > ////////////dos///////////////////
> > Microsoft Windows 2000 [Version 5.00.2195]
> > (C) Copyright 1985-2000 Microsoft Corp.
> >
> > C:\Documents and Settings\Administrator>cd ..
> >
> > C:\Documents and Settings>cd ..
> >
> > C:\>set CLASSPATH=
> >
> > C:\>ant
> > Buildfile: build.xml
> >
> > clean:
> > [delete] Deleting directory C:\java\classes
> >
> > prepare:
> > [mkdir] Created dir: C:\java\classes
> >
> > compile:
> > [javac] Compiling 1 source file to C:\java\classes
> >
> > manifest:
> >
> > package:
> > [jar] Building jar: C:\java\classes\TidyTest.jar
> >
> > BUILD SUCCESSFUL
> > Total time: 8 seconds
> > C:\>java -jar java\classes\TidyTest.jar
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > atreides/monsters/T
> > idyTest
> >
> > C:\>
> >
> >
> > ///////////////////source/////////////
> > // adapted from source available at:
> > // <http://sourceforge.net/docman/display_doc.php?docid=1298&grou
> > p_id=13153>
> >
> >
> > package atreides.jtidy;
> >
> > import java.io.IOException;
> > import java.net.URL;
> > import java.io.BufferedInputStream;
> > import java.io.FileOutputStream;
> > import java.io.PrintWriter;
> > import java.io.FileWriter;
> > import org.w3c.tidy.Tidy;
> >
> >
> >
> > public class TidyTest implements Runnable {
> >
> >     private String url;
> >     private String outFileName;
> >     private String errOutFileName;
> >     private boolean xmlOut;
> >
> >     public TidyTest(String url, String outFileName, String 
> > errOutFileName, boolean xmlOut) {
> >         this.url = url;
> >         this.outFileName = outFileName;
> >         this.errOutFileName = errOutFileName;
> >         this.xmlOut = xmlOut;
> >     }//tidyTest
> >
> >     public void run() {
> >         URL u;
> >         BufferedInputStream in;
> >         FileOutputStream out;
> >         Tidy tidy = new Tidy();
> >
> >         tidy.setXmlOut(xmlOut);
> >         try {
> >             tidy.setErrout(new PrintWriter(new 
> > FileWriter(errOutFileName), true));
> >             u = new URL(url);
> >             in = new BufferedInputStream(u.openStream());
> >             out = new FileOutputStream(outFileName);
> >             tidy.parse(in, out);
> >         }//try
> >         catch ( IOException e ) {
> >             System.out.println( this.toString() + e.toString() );
> >         }//catch
> >     }//run
> >
> >     public static void main( String[] args ) {
> >
> > 	String url = "http://www.google.com/";
> > 	String output = "output.txt";
> > 	String errorLog = "errorLog.txt";
> >
> > //	TidyTest t1 = new TidyTest(url,output,errorLog,true);
> > //	Thread th1 = new Thread(t1);
> > //	th1.start();
> >     }//main
> > }//TidyTest
> >
> >
> >
> > Thank you,
> >
> > Thufir Hawat
> --
> ___________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message