gpt4 book ai didi

java - ANT 找不到特定的库

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:08:18 24 4
gpt4 key购买 nike

我正在尝试使用 SSHEXEC ANT task ,这需要 JSCH library .

当我尝试使用 SSHEXEC 任务时,我得到以下信息:

BUILD FAILED
/home/www/test/build/build.xml:140: Problem: failed to create task or type sshexec
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/root/.ant/lib
-a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

我已经把jsch-0.1.50.jar(最新的)放在了/usr/share/ant/lib, /root/.ant/lib 甚至尝试了以下操作:

ant my-sshexec-target-name -lib /path/to/jsch-0.1.50.jar

而且我不断收到同样的错误。我还尝试在所有相同位置将文件重命名为 jsch.jar。同样的结果。我在这里做错了什么?

更新

我还运行了 ant -diagnostics 并看到了这个:

...
-------------------------------------------
Tasks availability
-------------------------------------------
p4reopen : Not Available (the implementation class is not present)
image : Not Available (the implementation class is not present)
sshexec : Not Available (the implementation class is not present)
wlrun : Not Available (the implementation class is not present)
p4label : Not Available (the implementation class is not present)
p4revert : Not Available (the implementation class is not present)
p4submit : Not Available (the implementation class is not present)
scp : Not Available (the implementation class is not present)
p4change : Not Available (the implementation class is not present)
p4delete : Not Available (the implementation class is not present)
p4integrate : Not Available (the implementation class is not present)
rexec : Not Available (the implementation class is not present)
stlist : Not Available (the implementation class is not present)
telnet : Not Available (the implementation class is not present)
etc...

注意:sshexec : Not Available(实现类不存在)

这是什么意思?

最佳答案

在我的 Linux Mint Debian Edition 2 上,我遇到了同样的问题:想知道为什么“sshexec”任务在执行“ant -diagnostics”时显示为“不可用”。

我系统上的解决方案是另外安装软件包“ant-optional”。之后,通常的解决方案会按预期工作,比如将 jsch.jar 放入 ~/.ant/lib。

问候

关于java - ANT 找不到特定的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18028910/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com