This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
When using eclipse, compiling the web app and running it on a server is relatively straight-forward. Eclipse knows where the apache tomcat libraries are ( such as servlet-api.jar etc)
If you're writing an ant script to compile the classes from the command line... I get an error which I understand where it comes from...basically...javac complains because it cannot find the javax.* libraries.
adding the servlet-api.jar under WEB-INF/lib resolved the problem but now Tomcat complains with the following:
INFO: validateJarFile(/Library/Tomcat/apache-tomcat-6.0.20/wtpwebapps/iSquirrel/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
anyone knows how to fix this?
Generally, what needs to be included in WEB-INF/lib so that the web app compiles correctly using command-line? I would suspect that the tomcat jar files are not needed as long as you include them in the classpath when compiling?
You can't add a library directory to a classpath in Java and use what's in the jars in that directory. That's not how the JVM works. It won't automatically search the jars.
However, in most cases, for a J2EE build, if you include $TOMCAT_HOME/lib/jsp-api.jar and $TOMCAT_HOME/lib/servlet-api.jar to your compile classpath that's all you need. You don't need every jar in $TOMCAT_HOME/lib.
Customer surveys are for companies who didn't pay proper attention to begin with.
To be clear here I agree with Tim, my flippant yes response was simply because I mis-interpreted by what you meant as TOMCAT CLASSPATH. Tim is in fact correct in that you should have specific JARs in your CLASSPATH as opposed to an entire folder.
subject: Compiling a dynamic web app from command line