ant scp needs jsch.jar in Eclipse
July 29th, 2011
If in Eclipse, using ant scp you get the error:
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:\Program Files (x86)\Eclipse\plugins\org.apache.ant_1.8.2.v20110505-1300\lib
-C:\Users\pbu.DESKTOP-KSA\.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
You need to do 3 things:
- get
jsch.jar
from http://www.jcraft.com/jsch/ - place it in the ant folder as indicated in the error
- add the jar to the ant classpath in Eclipse
Window/Preferences/Ant/Runtime/Ant Home Entries – Add external JARs, choose your jsch.jar
Thanks so much Phil, saved my day
where is Window/Preferences/Ant/Runtime/Ant Home Entries ?
In Eclipse, “Window” is a menu in the tool bar on the top. In there you find a “Preferences” menu item and click on it. The Preferences window opens, you choose Ant in the left list, and the sub-items Runtime and then AntHome Entries