Thomas Sundberg

January 16, 2012

Missing ant-jsch.jar

Filed under: Automation — Tags: , , — Thomas Sundberg @ 21:25

This post has been migrated to

The distribution of Ant 1.8.2 is broken on Mac.

It turns out that just adding jsch-0.1.45.jar to /usr/share/ant/lib is not enough if you want to use sshexec to execute ssh commands on a remote host. You will still get the error:

/Users/tsu/projects/linkon/fp/sabine/resources/deploy/build.xml:57: Problem: failed to create task or type sshexec
Cause: the class was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -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

The solution is to download the ant distribution and manually patch it’s lib directory with ant-jsch.jar. In my case I added it to /usr/share/ant/lib

This will allow you to use ssh from Ant.


1 Comment »

  1. […] digging a bit, I found out this interesting post that mention how the ANT 1.8.2 installation on Mac OS X is broken. Therefore, I downloaded the ANT […]

    Pingback by Rogue AI - Ssh ANT tasks and Mac OS X — December 3, 2012 @ 15:52

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: