ket*_*ega 10 java ant classloader
我的Ant脚本有问题.
我需要将文件复制到Linux服务器
<copy file="../Ant/lib/jsch-0.1.50.jar" tofile="${ant.home}/lib/jsch-0.1.50.jar" />
<scp todir="${server.user}:${server.password}@${server.dev}:${server.dev.dir.config}" trust="true" verbose="true">
<fileset dir="${src.home}/Config/">
<include name="**/*" />
</fileset>
</scp>
Run Code Online (Sandbox Code Playgroud)
文件已正确复制,但我收到此错误:
BUILD FAILED
C:\dev.xml:179: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/Logger
It is not enough to have Ant's optional JARs
you need the JAR files that the optional tasks depend upon.
Ant's optional task dependencies are listed in the manual.
Action: Determine what extra JAR files are needed, and place them in one of:
-C:\Progs\eclipse\plugins\org.apache.ant_1.8.3.v201301120609\lib
-C:\Users\Administrator\.ant\lib
-a directory added on the command line with the -lib argument
Run Code Online (Sandbox Code Playgroud)
如何在Ant类加载器中动态添加此JAR?
Exp*_*ing 12
Exception本身非常清楚,并指出了问题的原因:
Action: Determine what extra JAR files are needed, and place them in one of:
-C:\Progs\eclipse\plugins\org.apache.ant_1.8.3.v201301120609\lib
-C:\Users\Administrator\.ant\lib
-a directory added on the command line with the -lib argument
Run Code Online (Sandbox Code Playgroud)
jsch.jar 0.1.50或更高版本:sshexec和scp任务(http://www.jcraft.com/jsch/index.html)
如果您在ant lib中复制此lib,它将解决独立Ant的问题.
对于Eclipse的情况:进入Eclipse首选项,在Ant/Runtime条目中,在"Classpath"选项卡中.使用"Add External Jars"按钮将jsch.jar添加到Ant的类路径中.
| 归档时间: |
|
| 查看次数: |
26940 次 |
| 最近记录: |