This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Any ideas why my class isn't getting found? 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 "Any ideas why my class isn Watch "Any ideas why my class isn New topic

Any ideas why my class isn't getting found?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436

I wrote a custom task for Ant (using Ant 1.7, Java 1.6). The custom task references the log4j framework, and even though I include it in my classpath, I'm getting a "class cannot be found" error. Here is the relevant part of my Ant task ...

and here is the output I'm getting ...

Notice that log4j is included. I have verified the path exists. Any ideas what else I should check for? - Dave
Greg Charles

Joined: Oct 01, 2001
Posts: 2929

Hmm, that's a puzzle. Still, it must be something. You're picking up log4j from Tomcat, right? (/Library/Tomcat/Home/common/log4j-1.2.4.jar) I'd suggest to keep picking at the obvious things. Is the jar really there with exactly the same name? (I know you verified it already, and Ant must be picking it up somehow. Still a quick "file /Library/Tomcat/Home/common/log4j-1.2.4.jar" would double-check) Is the file readable by whatever user is running Ant? If you look in the jar, is the Logger class there and in the right package?

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Any ideas why my class isn't getting found?
It's not a secret anymore!