Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat, Apache, ANT ENV Variable HELL

 
Rich Williams
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.NoClassDefFoundError: Files\Apache

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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic