• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Classpath Error on Apache ANT

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a build.xml file which is as follows:
--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project name="Import" default="execute" basedir=".">
<description>Build file for BizBSS</description>
<target name="init" description="Initialize environment">
<mkdir dir="${basedir}\bin"/>
<copy todir="${basedir}\bin" file="${basedir}\src\server.properties"/>
<copy todir="${basedir}\bin" file="${basedir}\src\client.properties"/>
</target>
<target name="compile" description="Compile source" depends="init">
<javac destdir="bin" srcdir="src">
</javac>
</target>
<target name="execute" description="Execute" depends="compile">
<java classname="com.biz.apollo.client.BizFileReceiver" classpath="bin"/>
</target>
</project>

When I run this build file I am getting an error (below):
---------------------------------------------------------
D:\server\BizBSS>ant
Buildfile: build.xml

init:

compile:

execute:
[java] Could not find com.biz.apollo.client.BizFileReceiver. Make sure you have it in your classpath
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava
.java:170)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)

[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[java] at org.apache.tools.ant.Task.perform(Task.java:364)
[java] at org.apache.tools.ant.Target.execute(Target.java:341)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

BUILD SUCCESSFUL
Total time: 2 seconds
D:\server\BizBSS>
-------------------------------------------------------------

I understood that this is because of invalid classpath, but I don't know how to set the classpath in java task (I believe that the the classpath attribute I have set in Java task is wrong).

Please help me in this...
Thanks in advance..

Ratheesh
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try running ant -v to get verbose output that should show you what it is using as the classpath.

Check the ant manual Java task documentation for classpath examples. [If you are not using ant 1.7 use the documentation from the correct version, ant downloads include this documentation.]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic