Note that there are some explanatory texts on larger screens.

plurals
  1. POcompiling ant build and running jar
    primarykey
    data
    text
    <p>Hi i'm trying to create an ant build that i can run from command prompt. when i run the jar file containing the main method i get this:</p> <pre><code> Exception in thread "main" java.lang.NoClassDefFoundError: com/fmd/raptorurls/RaptorURLs Caused by: java.lang.ClassNotFoundException: com.fmd.raptorurls.RaptorURLs at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: com.fmd.raptorurls.RaptorURLs. Program will exit. </code></pre> <p>here is my ant build:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;project name="RaptorURLCheck" basedir="." default="cleanDistFiles"&gt; &lt;tstamp&gt; &lt;format property="currentYear" pattern="yyyy" /&gt; &lt;/tstamp&gt; &lt;!-- =================================================================== --&gt; &lt;!-- Global Properties - define in build.properties --&gt; &lt;!-- =================================================================== --&gt; &lt;property file="build.properties" /&gt; &lt;!-- =================================================================== --&gt; &lt;!-- Paths --&gt; &lt;!-- =================================================================== --&gt; &lt;path id="runtime-libs"&gt; &lt;fileset dir="${lib.dir}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/path&gt; &lt;path id="manifest-classpath"&gt; &lt;fileset dir="${lib.dir}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/path&gt; &lt;manifestclasspath property="jar.classpath" jarfile="${lib.dir}/${project.name}.jar" &gt; &lt;classpath refid="manifest-classpath" /&gt; &lt;/manifestclasspath&gt; &lt;target name="clean" &gt; &lt;echo&gt;***** Deleting files for ${project.name} *****&lt;/echo&gt; &lt;delete failonerror="false" dir="${bin.dir}" /&gt; &lt;delete failonerror="false" dir="${dist.dir}" /&gt; &lt;delete failonerror="false" dir="${log.dir}" /&gt; &lt;delete failonerror="false" dir="${conf.dir}" /&gt; &lt;/target&gt; &lt;target name="init" depends="clean"&gt; &lt;echo&gt;***** Creating required directories for ${project.name} build *****&lt;/echo&gt; &lt;tstamp /&gt; &lt;mkdir dir="${bin.dir}" /&gt; &lt;mkdir dir="${dist.dir}" /&gt; &lt;mkdir dir="${log.dir}" /&gt; &lt;mkdir dir="${conf.dir}" /&gt; &lt;/target&gt; &lt;target name="compile" depends="init" &gt; &lt;echo&gt;***** Compiling source files for ${project.name} *****&lt;/echo&gt; &lt;!--This javac compiles the java/src directory--&gt; &lt;javac srcdir="${src.dir}" includeantruntime="false" destdir="${bin.dir}" debug="on" debuglevel="lines,var,source"&gt; &lt;include name="**/*.java" /&gt; &lt;classpath refid="runtime-libs" /&gt; &lt;/javac&gt; &lt;copy todir="${bin.dir}"&gt; &lt;fileset dir="${src.dir}"&gt; &lt;include name="**/*.html" /&gt; &lt;include name="**/*.css" /&gt; &lt;/fileset&gt; &lt;fileset dir="${config.dir}"&gt; &lt;include name="*-.xml" /&gt; &lt;include name="*.xsd" /&gt; &lt;include name="*.properties" /&gt; &lt;/fileset&gt; &lt;/copy&gt; &lt;/target&gt; &lt;target name="jar" depends="compile" description="Packages app as jar" &gt; &lt;echo&gt;***** Creating jar distribution for ${project.name} *****&lt;/echo&gt; &lt;jar destfile="${lib.dir}/${project.name}.jar"&gt; &lt;manifest&gt; &lt;attribute name="Class-Path" value="${jar.classpath}" /&gt; &lt;attribute name="Built-By" value="${user.name}" /&gt; &lt;attribute name="Main-Class" value="${main.class}" /&gt; &lt;/manifest&gt; &lt;fileset dir="${bin.dir}"&gt; &lt;include name="**/*.class*" /&gt; &lt;include name="**/*.xml" /&gt; &lt;include name="**/*.html" /&gt; &lt;include name="**/*.css" /&gt; &lt;include name="**/*.properties" /&gt; &lt;/fileset&gt; &lt;fileset dir="${config.dir}"&gt; &lt;include name="**/*.xml" /&gt; &lt;include name="**/*.xsd" /&gt; &lt;/fileset&gt; &lt;/jar&gt; &lt;/target&gt; &lt;target name="copyDistFiles" depends="jar"&gt; &lt;echo&gt;***** Copying distribution files for ${project.name} *****&lt;/echo&gt; &lt;mkdir dir="${dist.dir.lib}" /&gt; &lt;mkdir dir="${dist.dir.conf}" /&gt; &lt;mkdir dir="${dist.dir.log}" /&gt; &lt;copy todir="${dist.dir.lib}"&gt; &lt;fileset dir="${lib.dir}" excludes="*.db" /&gt; &lt;/copy&gt; &lt;copy todir="${dist.dir.conf}"&gt; &lt;fileset dir="${conf.dir}" /&gt; &lt;/copy&gt; &lt;/target&gt; &lt;target name="zip" depends="copyDistFiles"&gt; &lt;echo&gt;***** Zipping distribution files for ${project.name} *****&lt;/echo&gt; &lt;zip destfile="./Linux_5.5_${project.name}.zip" basedir="${dist.dir}" excludes="*.db" /&gt; &lt;/target&gt; &lt;target name="cleanDistFiles" depends="zip"&gt; &lt;echo&gt;***** Deleting distribution files for ${project.name} *****&lt;/echo&gt; &lt;delete dir="${dist.dir}/lib" /&gt; &lt;delete dir="${dist.dir.conf}" /&gt; &lt;delete dir="${dist.dir}/log" /&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>and here is my build properties:</p> <pre><code> project.name=${ant.project.name} app.dir=${basedir} src.dir=${basedir}/src lib.dir=${basedir}/lib log.dir=${basedir}/logs conf.dir=${basedir}/config bin.dir=./bin bin.dir.lib=${bin.dir}/lib dist.dir=./dist dist.dir.conf=${dist.dir}/config dist.dir.lib=${dist.dir}/lib dist.dir.log=${dist.dir}/logs main.class=com.fmd.raptorurls.RaptorURLs spring.config.dir=./lib config.dir=./config/ all.config.dir=./apps/fps/raptorurls/config build_env=all </code></pre> <p>Don't know what i am doing wrong. also i'm using spring</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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