Ant Javac 和 Commandline Javac 给出不同的结果 [英] Ant Javac and Commandline Javac give different results
问题描述
我有一个类可以导入一些 servlet 库.当我从命令行编译它时,它很好.
I have a class that imports some servlet libraries. When I compile it from command-line it is fine.
当我使用 ant compile 任务编译它时,它给出了在其路径中找不到 servlet 库的错误.
When I use the ant compile task to compile it, it gives the errors that it can't find the servlet libraries in its path.
这是已知的/常见的事件吗?
Is that a known/common occurrence?
这是我的 Ant 目标:
Here is my Ant target:
<target name="compile" depends="prepare" description="compile the source" >
<echo>=== COMPILE === SRCDIR: ${src}/com/udfr/src/java </echo> <!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}/com/udfr/src/java" destdir="${dist}/WEB-INF/classes"/>
</target>
推荐答案
如果您没有在 javac
任务的类路径中正确指定 servlet 库,这种情况很常见...我怀疑那就是问题所在.如果您发布失败的任务和有效的命令行,我们将能够提供更多帮助.
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.
这篇关于Ant Javac 和 Commandline Javac 给出不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!