java – Error building project with Commons-Email-1.4 library


In my project I needed to add the option to send emails I added the library commons-email-1.4 I wrote all the code and tested it. So far everything is perfect, but when cleaning and building the application's .jar file, the error appears.

ant -f C:\\Users\\Clayton\\Documents\\NetBeansProjects\\Agil307 - clean jar
Updating property file: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\
Deleting directory C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build
Created dir: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build
Updating property file: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\
Created dir: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\classes
Created dir: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\classes\META-INF
Copying 1 file to C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\classes\META-INF
Created dir: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\empty
Created dir: C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\generated-sources\ap-source-output
Compiling 401 source files to C:\Users\Clayton\Documents\NetBeansProjects\Agil307\build\classes
C:\Users\Clayton\Documents\NetBeansProjects\Agil307\nbproject\build-impl.xml:929: The following error occurred while executing this line:
C:\Users\Clayton\Documents\NetBeansProjects\Agil307\nbproject\build-impl.xml:269: Error running C:\Program Files\Java\jdk1.8.0_31\bin\javac.exe compiler
FALHA NA CONSTRUÇÃO (tempo total: 49 segundos)

Lines referring to the above errors in the build-impl.xml file

 928<target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 929   <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 930      <copy todir="${build.classes.dir}">
 931         <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 932      </copy>

  269<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${}" tempdir="${}">
  270           <src>
  271               <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  272                   <include name="*"/>
  273               </dirset>
  274           </src>

If I remove the commons-email-1.4 library and remove the code from the project it builds fine.

I don't know what I can do to fix the problem.

Just for the record I'm using JDK 8.


After a few days testing this situation I got a solution, I make use of several libraries and some were added but not in use, so in this case I scanned the used libraries and removed some of them and then tried to carry out the cleaning and construction process , and it just worked now I don't know if the project or the compiler accepts a maximum number of libraries and if there was any conflict of some libraries, apparently the removed libraries had nothing to do with the last ones added.

Scroll to Top