ant scp needs jsch.jar in Eclipse

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:

  1. get jsch.jar from http://www.jcraft.com/jsch/
  2. place it in the ant folder as indicated in the error
  3. add the jar to the ant classpath in Eclipse
    Window/Preferences/Ant/Runtime/Ant Home Entries – Add external JARs, choose your jsch.jar

Posted

in

by

Tags: