ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles M├ęgnin <cha...@theblueplanet.org>
Subject classpath inconsistency ?
Date Mon, 27 Aug 2001 15:42:03 GMT
Hi,
I can't figure out why I get inconsistent results when I want to execute

bytecode with ant & when I do so on the command line:

java -classpath /home/charly/classes
org.theblueplanet.music.MusicianQuery

runs fine but the following produces:

charly@localhost [/home/charly]:(59)% ant musictest
Buildfile: build.xml

init:

build:

musictest:

BUILD FAILED

/home/charly/src/org/theblueplanet/build.xml:38:
java.lang.NoSuchMethodException: main
--- Nested Exception ---
java.lang.NoSuchMethodException: main
 at java.lang.Class.getMethod0(Class.java:1720)
 at java.lang.Class.getMethod(Class.java:945)
 at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:126)
 at org.apache.tools.ant.taskdefs.Java.run(Java.java:260)
 at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:123)
 at org.apache.tools.ant.taskdefs.Java.execute(Java.java:87)
 at org.apache.tools.ant.Target.execute(Target.java:153)
 at org.apache.tools.ant.Project.runTarget(Project.java:898)
 at org.apache.tools.ant.Project.executeTarget(Project.java:536)
 at org.apache.tools.ant.Project.executeTargets(Project.java:510)
 at org.apache.tools.ant.Main.runBuild(Main.java:421)
 at org.apache.tools.ant.Main.main(Main.java:149)

(and there is a main in MusicianQuery.java)
The relevant ant snippet is:

  <target name="musictest" depends="compile">
    <java classname="org.theblueplanet.music.MusicianQuery">
      <classpath>
        <pathelement path="${build.classpath}" />
      </classpath>
    </java>
  </target>

  <path id="build.classpath">
    <pathelement location="/home/charly/classes" />
  </path>

Thanks for your ideas,
Charles


Mime
View raw message