aspose file tools
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
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\

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\
3: package does not exist
[javac] import*;
[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: 31634

Please check your private messages.

[OCA 8 book] [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: 3370

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


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: 3370

That's great. Thank you
I agree. Here's the link:
subject: Ant CLASSPATH Question