• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

package org.apache.log4j does not exist (Ant build compile)

 
Ranch Hand
Posts: 99
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I'm not positive if this should be in this forum or in the Ant forum...

Through the charities of JavaRanch members over on the Ant forum, I was able to get my build file to work properly. However, when I incorporate log4j classes in the build, I get the error "package org.apache.log4j does not exist". I added the log4j jar to my environment variables appended to "CLASSPATH". I also have the log4j jar file deployed on my web-inf target.

Eclipse has no problem finding the log4j.jar. But, I can't seem to help Ant find it when I run my build.xml file in Eclipse. I appreciate the help.

The compiler error is:



The build file location is:



The error occurs at line 101 unless I remove all references to log4j. If I do that, I get no compiler complaints.

Best,
Al
 
Al Johnston
Ranch Hand
Posts: 99
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, since I'm new to log4j (and ant for that matter), I made sure to follow the instructions for setting up the log4j classpath. I ran the log4j Hell.java example from a command prompt and got the expected Logger output.

 
Al Johnston
Ranch Hand
Posts: 99
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out (finally). In my build.xml file, I have a few classpaths set. Like so:


Later, when I do my class compile, I call these class paths...



Despite having an environmental variable set up and having log4j.jar in the web-inf and common/lib directories of Tomcat, the only way the compile works is when I put log4j.jar in classpath.build directory.

Thanks!

Al
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic