Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6883417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:22:51+00:00 2026-05-27T05:22:51+00:00

I have following ant mail task – <target name=sendtestreport > <mail mailhost=smtp.com mailport=1025 subject=Test

  • 0

I have following ant mail task –

<target name="sendtestreport" > 
    <mail mailhost="smtp.com" mailport="1025" subject="Test build" >
        <from address="test@gmail.com" />           
        <replyto address="test@gmail.com" />
        <to address="test@gmail.com" />
        <message>test message</message>
        <attachments>
        </attachments>
    </mail>
</target>

And I have both activation and mail jar available in my project “lib” folder. I want to be able to send mail with out having to keep these jars in ant download location. Is it possible to let ant know about my “lib” folder to see javaxmail and activation jars. Some thing like If I could specify class path from with in this target.

Right now when I execute this target I always encounter exception –

BUILD FAILED
java.lang.ClassNotFound
Exception: javax.mail.internet.MimeMessage
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:22:52+00:00Added an answer on May 27, 2026 at 5:22 am

    Unforunately you can’t.
    You have to put Library Dependencies into the ant classpath somehow.

    This could be the ANTH_HOME/lib dir or a change to the command line arguments.

    Ant has a command-line argument to specify a lib dir:

    -lib <path> specifies a path to search for jars and classes
    

    You could also call ant from ant itself with that info, which may be a bit ugly:

    <exec executable="ant">
      <arg value="-lib"/>
      <arg value="PATH_TO_MY_LIB"/>
      <arg value="target"/>
    </exec>
    

    If you execute this task from eclipse, you can add the libs to the run definition of the task and share this run definition with other developers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ant task: <target name=test> <replace file=test.txt token=smth value=anything/> </target> test.txt
I have the following tasks in ant: <target name=init-junit depends=init> <mkdir dir=${junit.reports.individual} /> <property
I have following ant file to build. But unfortunately <project default=build.deploy.start basedir=.> <property name=target.dir
I have an ant script with the following header: <project name=Simple ActiveJDBC Example default=clean
We currently have an ant task that contains something similar to the following: <filelist
I have the following in my build.xml: <target name=compile.baz depends=init> <javac destdir=${build.dir}/classes debug=on> <compilerarg
I have the following ant build.xml : <path id=antclasspath> <fileset dir=lib> <include name=*.jar/> </fileset>
I have the following ant target: <delete> <fileset dir=${qnaire_dir} includes=**/*~ /> </delete> It does
I have the following Ant build file: <?xml version=1.0 encoding=UTF-8?> <project default=build name=MyAntScript> <!--
I have following target in mz ant script to build my java application <target

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.