Hello!
I have written a logic gate program that uses a properties file to essentially access the proper class (as part of an assignment). This is working fine. However, I am supposed to create a build.XML file that contains the information for the jar.
I have a sample program that my professor wrote that works fine. Mine does not. Therefore, I tried I copying and paste his over to mine (and change the appropriate words) mine does not work (as per his suggestion). More specifically, I am able to create the jar file, but after the main user interface loads, when I select something in it that needs the properties file it closes out. When I run it through Apache
Ant, it says "Property file location not set. Passed in value is: null". The properties file is physically there (I have it copy to the build folder and I have double-checked that it is showing up in the jar as well.)
I had messed around with some of the Eclipse settings so I am worried I screwed something up there when my xml file is actually fine.
I have pasted my build.xml file underneath for your further information.
Any ideas?? I have spent nearly a week trying to get this to work!
-----------------------------------------------------------------------------------------------------------
<?xml version="1.0" ?>
<!--
logicgate Ant Build.xml file
-->
<project name="logicgate" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="bin.dir" value="${basedir}/classes"/> <!-- NOTE: bin maps to classes in FleetRental!! -->
<property name="build.dir" value="${basedir}/build"/>
<property name="config.dir" value="${basedir}/config"/>
<property name="lib.dir" value="${basedir}/lib"/>
<!-- Classpath for the project -->
<path id="master-classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Cleanup and Dir Creation -->
<target name="clean" description="Deletes old and creates new classes, and build directories.">
<delete dir="${bin.dir}"/>
<mkdir dir ="${bin.dir}"/>
<delete dir="${build.dir}"/>
<mkdir dir ="${build.dir}"/>
</target>
<!-- Compiling Code -->
<target name="compile" description="Compiles code" depends="clean">
<javac srcdir="${src.dir}"
destdir="${bin.dir}">
<classpath refid="master-classpath"/>
</javac>
</target>
<!-- Build Jar -->
<target name="buildjar" depends="compile">
<jar jarfile="${build.dir}/logicgate.jar">
<fileset dir="${basedir}">
<include name="config/*"/>
</fileset>
<fileset dir="${bin.dir}">
<include name="**/*.class"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="com.logicgate.view.presentation.MainUI"/>
</manifest>
</jar>
<!-- Copy the config folder over to the build folder: application needs this to load properties file-->
<copy todir="${build.dir}">
<fileset dir="${basedir}">
<include name="config*/**/*"/>
</fileset>
</copy>
</target>
<!-- Execute Jar -->
<target name="testjar" depends="buildjar">
<
java jar="${build.dir}/logicgate.jar" fork="yes" dir=".">
</java>
</target>
</project>