reddragdiva: (geek)
divabot ([personal profile] reddragdiva) wrote2016-05-19 11:05 am

Getting jsch to work in ant in Ubuntu.

Yet another in the series "stuff I'm blogging so future poor buggers can find it in Google."

If you've seen this supercilious and not actually helpful error from ant:

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:
-/usr/share/ant/lib
-/home/fun/.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

— it is a bloody bug, and it's a bug in Ubuntu that hasn't been fixed in years.

  1. Install the relevant packages: sudo apt-get install ant-optional libjsch-java
  2. The symlink to make it work! sudo ln -s /usr/share/java/jsch.jar /usr/share/ant/lib/

The bug is that it should make that symlink. (The other bug is that ant-optional should have libjsch-java as a dependency and doesn't.)

vampwillow: (Default)

[personal profile] vampwillow 2016-05-20 02:58 pm (UTC)(link)
#sofixit would be the standard response, but I'm having enough problems with stuff (IPv6 through local router) that I wouldn't wish extra work on anyone presently!