找不到类org.apache.tools.ant.taskdefs.optional.ssh.SSHExec
ant找不到类org.apache.tools.ant.taskdefs.optional.ssh.SSHExec,这是我的一个常见问题。但是,常见的解决方案不适合我:找不到类org.apache.tools.ant.taskdefs.optional.ssh.SSHExec,ant,jsch,Ant,Jsch,ant找不到类org.apache.tools.ant.taskdefs.optional.ssh.SSHExec,这是我的一个常见问题。但是,常见的解决方案不适合我: 确保类路径中存在jsch.jar和ant-jsch.jar 确保上述JAR没有多个不同版本 确保ant-diagnostics实际上能够看到JAR 我不知道我下一步应该尝试什么。我得到的输出是良好的‘ol: build.xml: Problem: failed to create task or type sshexec Cau
build.xml: 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
-/opt/home/myname/.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.
我的设置:
- ant版本:ApacheAnt(TM)版本1.9.2于2014年1月22日编译
- ant jsch版本:1.9.2
- jsch版本:0.1.52
有什么想法吗?遇到了一个与您的问题非常相似的问题,问题是SCP而不是SSH,但在其他方面是相同的。我并没有说您是否自己编译了Ant,或者使用了二进制发行版,但我们发现Ant-jsch.jar的编译不正确。编译时没有问题的迹象,但jar比预期的小得多,只有6k。我们通过使用二进制发行版中的ant-jsch.jar(48k)修复了这个问题。这是在ant-1.9.4和ant-1.9.5、Java1.8.045中实现的 我遇到了几乎相同的问题,尤其是ant-diagnostics显示sshexec任务“不可用” 在我的系统上,解决方案是另外安装包“ant optional”(正如我已经在这里发布的:) 也许这有帮助 问候