Note that there are some explanatory texts on larger screens.

plurals
  1. POException in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
    primarykey
    data
    text
    <p>I'm trying to build an application using ant. Everything appears to be fine when I build but I continually get the above error for what I've tried so far.</p> <ul> <li><code>java -jar dist/pmml_export.jar</code></li> <li><code>java -cp ".:log4j-1.2.16.jar" -jar dist/pmml_export.jar</code></li> <li><code>java -cp log4j-1.2.16.jar -jar dist/pmml_export.jar</code></li> </ul> <p>I doubled checked to see if Layout was in the jar I'm referencing and it is there. I'm fairly new to both ant and log4j so I could be making an obvious mistake but I'm just not seeing it. Here is my <code>build.xml</code>.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;project name="pmml_export" default="archive"&gt; &lt;target name="init"&gt; &lt;mkdir dir="build/classes" /&gt; &lt;mkdir dir="dist" /&gt; &lt;/target&gt; &lt;path id="compile.classpath"&gt; &lt;fileset dir="build/classes" includes="*.class" /&gt; &lt;/path&gt; &lt;property name="ant.dir" value="apache-log4j-1.2.16"/&gt; &lt;path id="classpath"&gt; &lt;fileset dir="${ant.dir}" includes="**/*.jar"/&gt; &lt;/path&gt; &lt;target name="exceptions" depends="init"&gt; &lt;javac srcdir="src/exceptions" destdir="build/classes" classpathref="compile.classpath"/&gt; &lt;echo&gt; Exceptions compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="symbol-table" depends="exceptions" &gt; &lt;javac srcdir="src/translator/symbol_table" destdir="build/classes" classpathref="compile.classpath"/&gt; &lt;echo&gt; Symbol table compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="parser" depends="symbol-table" &gt; &lt;javac srcdir="src/translator/parser" destdir="build/classes" classpathref="compile.classpath"/&gt; &lt;echo&gt; Parser compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="lexer" depends="parser" &gt; &lt;javac srcdir="src/translator/lexer" destdir="build/classes" classpathref="compile.classpath"/&gt; &lt;echo&gt; Lexer compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="translator" depends="lexer" &gt; &lt;javac srcdir="src/translator" destdir="build/classes" classpathref="compile.classpath"/&gt; &lt;echo&gt; Translator compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="exporter" depends="translator" &gt; &lt;javac srcdir="src/pmml_export" destdir="build/classes" classpathref="compile.classpath" /&gt; &lt;echo&gt; Exporter compiled! &lt;/echo&gt; &lt;/target&gt; &lt;target name="archive" depends="exporter" &gt; &lt;property name="manifest.mf" location="dist/manifest.txt" /&gt; &lt;manifest file="${manifest.mf}" &gt; &lt;attribute name="Main-Class" value="pmml_export.PMML_Export"/&gt; &lt;/manifest&gt; &lt;jar destfile="dist/pmml_export.jar" manifest="${manifest.mf}" basedir="build/classes" /&gt; &lt;/target&gt; &lt;target name="run" depends="archive"&gt; &lt;java jar="dist/pmml_exporter.jar" fork="true"&gt; &lt;classpath&gt; &lt;path refid="classpath"/&gt; &lt;path location="dist/pmml_exporter.jar"/&gt; &lt;/classpath&gt; &lt;/java&gt; &lt;/target&gt; &lt;/project&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload