wood burning stoves
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant CLASSPATH Question" Watch "Ant CLASSPATH Question" New topic

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


[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

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

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 ...

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32635

Please check your private messages.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

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!

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

That's great. Thank you
I agree. Here's the link: http://aspose.com/file-tools
subject: Ant CLASSPATH Question
It's not a secret anymore!