蚂蚁和javac的命令行javac的给出不同的结果 [英] Ant Javac and Commandline Javac give different results

查看:188
本文介绍了蚂蚁和javac的命令行javac的给出不同的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些进口的servlet库的类。当我的命令行编译它是好的。

当我使用ant编译任务编译它,它给人的错误,它无法找到在其路径在servlet库。

是一个已知的/普遍的现象?

下面是我的Ant目标:

 <目标名称=编译取决于=prepare描述=编译源>
    <回声> === COMPILE === SRCDIR:$ {}的src / COM / udfr / src目录/ JAVA< /回声> <! - 从$ {src}字符串为$ {}构建编译java code - >
    < javac的SRCDIR =$ {}的src / COM / udfr / src目录/ Java的DESTDIR =$ {} DIST / WEB-INF / classes中/>
< /目标与GT;


解决方案

这是一个普遍的现象,如果你没有在类路径 javac的正确指定的servlet库任务......我怀疑这就是问题所在。如果您发布它出现故障时的工作命令行的任务,我们将能够帮助更多。

I have a class that imports some servlet libraries. When I compile it from command-line it is fine.

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?

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>

解决方案

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.

这篇关于蚂蚁和javac的命令行javac的给出不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆