This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Tomcat, Apache, ANT ENV Variable HELL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Tomcat, Apache, ANT ENV Variable HELL" Watch "Tomcat, Apache, ANT ENV Variable HELL" New topic
Author

Tomcat, Apache, ANT ENV Variable HELL

Rich Williams
Greenhorn

Joined: Jun 17, 2004
Posts: 3
Hi All,

I've been trying unsuccessfully now for 4+ hours to get to the point where i can run ant to compile a servlet. This is insanely confusing. Atleast for me. Yes this is the first attempt. I can't imagine it being anymore frustrating. Why wouldn't the creators of these packages include the setting of environment variables in their installations? It makes absolutely no sense to me. If somene can offer any kind of help i would greatly appreciate it!

when i run ant to i am getting the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: Files\Apache

From everything i've been reading this is an env variable problem. But i just can't imagine what?? Please help! and thanks so much in advance!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
You should be able to get Tomcat to run by setting the single JAVA_HOME environment variable and possibly CATALINA_HOME - otherwise Tomcat ignores all CLASSPATH settings.
Looking in the ANT docs - Ant\docs\manual\index.html - the Installing Ant section, we find a discussion of what Ant likes to see for environment variables for windows and unix systems.
Can you get ant to respond with to a -version command?
Can you get Tomcat to run so you can see the installed documentation?
Which Java SDK are you working with?
Bill
Rich Williams
Greenhorn

Joined: Jun 17, 2004
Posts: 3
Hi There! Thanks for replying.

this is the exact error:

java.lang.NoClassDefFoundError: Files\Apache

Tomcat and apache are running. I can run both the JSP and the Servlet examples and they work fine. I am running tomcat 5.025

I can't get a -version on ant. I get the same error.

Thanks for your help.

Oh yeah both those ENV variables are present

rw
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5

has me mystified - there should be a class name in there somewhere.
Exactly how are you executing ANT to get that error?
Why are you trying to run Apache and Tomcat? Tomcat does just fine as a plain HTML server.
Bill
Rich Williams
Greenhorn

Joined: Jun 17, 2004
Posts: 3
Hi William

Sorry i am not running both. Just tomcat. It appears as though the problem may still be with the ENV variables. The only thing i can think is the spaces in the directory structure are causing problems:

Tomcat is installed in:
C:\Program Files\Apache Software Foundation\Tomcat 5.0

the error shows:
Exception in thread "main" java.lang.NoClassDefFoundError: Files\Apache

What env variable would this be. I am running XP Pro.. shouldn't be a problem but it appears to be. I have also tried the ~1 naming and still getting the error. I a going t re-install to root.. Frustrating.

Oh yeah running ant, ant -version and ant anything returns that same error.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Since this is an Ant question, I am going to move this thread to the Ant forum.

This forum is for Servlets questions.

Good Luck.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat, Apache, ANT ENV Variable HELL
 
Similar Threads
Can't get JIBX to run in ANT
Setting Up Ant
the system cannot find the path specified
Integrating new Ant w/ SunONE (Forte4J)
Alternatives to Ant within Eclipse??