wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant CLASSPATH Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant CLASSPATH Question" Watch "Ant CLASSPATH Question" New topic
Author

Ant CLASSPATH Question

Aryeh Golob
Ranch Hand

Joined: Nov 12, 2006
Posts: 37
Trying to set up an ANT build for a project and am having some CLASSPATH issues.

Java File Located Here: c:\<MYPATH>\src\com\defenseknife\server\DnServer.java

I tried setting classpath in build.xml as specified in FAQ.

Here is the output ...

$ ant compile
Buildfile: build.xml

init:

compile:
[javac] Compiling 1 source file to c:\java\moteng\build
[javac] c:\java\moteng\src\com\defenseknife\server\DnServer.java:
3: package com.defenseknife.tools does not exist
[javac] import com.defenseknife.tools.*;
[javac] ^
[javac] 1 error

BUILD FAILED
c:\java\moteng\build.xml:22: Compile failed; see the compiler error output for d
etails.

Total time: 1 second

I am only getting this error when import statement is present.

If I set classpath through shell and do a straight javac, everything works.

Here is my build.xml ...



Any help is greatly appreciated!

Happy new year ...

-Qaz
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

"Qazzi",
Please check your private messages.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Howdy "Qazzi",

Welcome to JavaRanch

As one of our moderators (Jeanne) asked, please change your display name according to ranch's naming policy.

Everything looks fine. Where does your build.xml reside?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Aryeh Golob
Ranch Hand

Joined: Nov 12, 2006
Posts: 37
Happy New Year Raghavan!

Just figured it out.

I had the following import statement in DnServer.java

import com.defenseknife.tools.*;

As tools directory was empty, I could not compile even though directory existed.

Thanks a lot!

-Aryeh
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

That's great. Thank you
 
Consider Paul's rocket mass heater.
 
subject: Ant CLASSPATH Question
 
Similar Threads
Ant building error
Build failed- ejb3.deployer not found
Ant + Junit + Log4J Problem
Apache Ant add property file and policy file
Ant+JUnit