Ant Javac and Commandline Javac give different results

早过忘川 提交于 2019-12-02 04:17:19

It's a common occurrence if you don't specify the servlet libraries properly in the classpath for the javac task... I suspect that's the problem. If you post the task which fails and the command line which works, we'll be able to help more.

For some reason, the JAR file containing the Servlet API is part of your classpath when you compile your program in command line. However, it's not in the classpath of the javac Ant task.

You should explicitely add the JAR file to the classpath in your javac Ant task. There are several ways to do that; please read http://ant.apache.org/manual/Tasks/javac.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!