Reputation: 1731
I've been running the built-in Ant from the command line on a Macintosh (10.5.5) and have run into some trouble with the Mail task. Running the Mail task produces the following message:
[mail] Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
This is most likely due to a missing ant-javamail.jar file in the /usr/share/ant/lib directory. I see a "ant-javamail-1.7.0.pom" file in this directory but not the appropriate jar file. Anyone know why this jar file might be missing and what the best way to resolve the problem is?
Upvotes: 4
Views: 2548
Reputation: 1731
Here's what I ended up doing to resolve the problem:
ln -s /usr/local/share/apache-ant-1.7.1/bin/ant /usr/bin/ant
)If for some reason you need to make the old version of Ant the default again, just use
ln -s /usr/share/ant/bin/ant /usr/bin/ant
Steps 2-4 were done at the command prompt as root. That's it -- the Mac now has the latest, complete version of Ant and the Mail task works just fine.
Upvotes: 2
Reputation: 84338
I also got this working a slightly different way:
~/.ant/lib
.apache-ant-1.7.0/lib/ant-javamail.jar
file into that directory.This only solves the problem for a single user account, but that was fine for my purposes and saved me the hassle of having two separate ant installations on my machine.
Upvotes: 0
Reputation: 1985
Download the Java Mail libraries from: http://java.sun.com/products/javamail/ . You will also need http://java.sun.com/products/javabeans/glasgow/jaf.html
A list of all external dependencies required by Ant's optional tasks are outlined here http://ant.apache.org/manual/index.html .
Another way to get dependencies for Ant very easily, is to run:
ant -f fetch all
from $ANT_HOME. You can also run -projecthelp for a full list of targets:
all load all the libraries
antlr load antlr libraries
bcel load bcel libraries
beanshell load beanshell support
bsf load bsf libraries
debugging internal ant debugging
get-m2 Download the Maven2 Ant tasks
jdepend load jdepend libraries
jruby load jruby
junit load junit libraries
jython load jython
logging load logging libraries
networking load networking libraries (commons-net; jsch)
regexp load regexp libraries
rhino load rhino
script load script languages
xerces load an updated version of Xerces
xml load full XML libraries (xalan, resolver)
Upvotes: 1