Home > Uncategorized > ant scp needs jsch.jar in Eclipse

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:

  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

Uncategorized

  1. Felix
    September 4th, 2012 at 05:34 | #1

    Thanks so much Phil, saved my day :)

  2. December 16th, 2013 at 02:53 | #2

    where is Window/Preferences/Ant/Runtime/Ant Home Entries ?

  3. Phil
    December 16th, 2013 at 03:07 | #3

    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

  1. No trackbacks yet.