Hello all how can I create jar file of my project that is created in android using eclipse. I have done in this way project -> right-click->export --> select builder -->antbuilder-->ok then after this process build.xml will be created. On bulid.xml I will create new builder.
Right click on project -> properties --> select new -->give build.xml and your project path and press ok, new builder will be created.
Now select that builder from project properties and press ok.
Now build your project and your jar will be created in bin folder.
I have followed above process but my jar is not found in bin folder. I can see my build.xml is created and all process goes smooth but still jar is not created. Can any one tell me how can I do this?
My build.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="testtttttttttt">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="Android 2.2.libraryclasspath">
<pathelement location="C:/Program Files (x86)/Android/android-sdk/platforms/android-8/android.jar"/>
</path>
<path id="com.android.ide.eclipse.adt.LIBRARIES.libraryclasspath"/>
<path id="testtttttttttt.classpath">
<pathelement location="bin/classes"/>
<path refid="Android 2.2.libraryclasspath"/>
<path refid="com.android.ide.eclipse.adt.LIBRARIES.libraryclasspath"/>
</path>
<target name="init">
<mkdir dir="bin/classes"/>
<copy includeemptydirs="false" todir="bin/classes">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="bin/classes">
<fileset dir="gen">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin/classes"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin/classes" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="testtttttttttt.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin/classes" source="${source}" target="${target}">
<src path="gen"/>
<classpath refid="testtttttttttt.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>
In Eclipse, select project, right click on the project, Select Export, From that select Jar. Then follow the simple wizard and give the destination where you want to save your jar, and finish. You can find your jar there.
Step 1. Create Android library project as explained here.
Step 2. Now you need to give reference of Android Library project created in step 1 to your client application. There are two ways to do so.
•Give reference of Android Library Project itself by client app
property -> Select 'Android' on left pane -> In Libraty Section, Add
Android Libraty project (This is explained at link given in Step 1
above)
•Give the reference of .jar file of Android Library project
(from Location of Android Library project -> bin -> .jar file).
Client Application -> Properties -> Click 'Java Build Path' in lefe
pane -> Go to 'Libraries' Tab -> Click 'Add External JARs' button and
select the .jar file -> Go to 'Order and Export' tab and select the
added .jar file reference and move it to top.
Hope this will help you
Related
I have some problem, in my friend's code there is a clean code using apache ant seems to delete lib folder as well. but when I try to create project, it fails because the lib folder is missing. then how to build the correctly using ant apache ?
this is clean code
<target name="clean" description="--> clean the project">
<delete includeemptydirs="true">
<fileset dir="${basedir}">
<exclude name="src/**" />
<exclude name="build.xml" />
<exclude name="ivy.xml" />
</fileset>
</delete>
</target>
and this build code
<target name="build" description="Compile main source tree java files">
<mkdir dir="${build.dir}" />
<javac srcdir="${java.dir}" destdir="${build.dir}" classpathref="lib.path.id" debug="true" deprecation="true" optimize="true" failonerror="true" />
<!-- class path properties files -->
<copy file="${resource.dir}/log4j.properties" todir="${build.dir}" />
<copy file="${resource.dir}/mncplaymedia.properties" todir="${build.dir}" />
<copy todir="${build.dir}">
<fileset dir="${resource.dir}" />
</copy>
</target>
thank you
I think you have to build this project, then put the war or jar file in webapps on your web server (like jetty, tomcat and etc.)
I need to create build file for ant to build my JavaFX project, I have searched a lot, but nothing helped me. It still show errors but compiles. When I tries to run jar file - exceptions. I have tried different paths, but still nothing.
Here is my build.xml.
<?xml version="1.0" encoding="UTF-8" ?>
<project name="JDBC Ant Project" default="default" basedir="." xmlns:**fx="javafx:com.sun.javafx.tools.ant"**(Uri is not registered)>
<property name="src.dir" location="src"/>
<property name="build.dir" location="classes"/>
<property name="out.dir" location="out"/>
<property name="docs.dir" location="docs"/>
<property name="bin.dir" location="bin"/>
<property name="lib.dir" location="lib"/>
<property name="jar.name" value="javafxtest.jar"/>
<property name="sdk.dir" location="/usr/lib/jvm/java-8-oracle/lib"/>
<target name="default" depends="clean,compile">
<path id="fxant">
<filelist>
<file name="/usr/lib/jvm/java-8-oracle/lib/ant-javafx.jar"/>
<file name="/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar"/>
</filelist>
</path>
<*taskdef*(Failed to load types) resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpathref="fxant"/>
<fx:**application** id="HelloWorldID"
name="JDBC Java FX"
mainClass="Main"/>
<fx:resources id="appRes">
<fx:fileset dir="${out.dir}" includes="HelloWorld.jar"/>
</fx:resources>
<fx:jar destfile="${out.dir}/${jar.name}">
<fx:application refid="HelloWorldID"/>
<fx:resources refid="appRes"/>
<fileset dir="${build.dir}"/>
</fx:jar>
<fx:**deploy width**="300" **height**="250"
**outdir**="." **embedJNLP**="true"
**outfile**="helloworld">
<fx:**application** refId="HelloWorldID"/>
<**fx:resources** refid="appRes"/>
<**fx:info** title="JavaFX Hello World Application"
vendor="Oracle Corporation"/>
</fx:**deploy**>
</target>
<target name="clean">
<echo>Performing clean target</echo>
<delete dir="${build.dir}"/>
<delete dir="${docs.dir}"/>
<delete dir="${out.dir}"/>
</target>
<target name="init">
<echo>Performing init target</echo>
<mkdir dir="${build.dir}"/>
<mkdir dir="${docs.dir}"/>
<mkdir dir="${out.dir}"/>
</target>
<target name="compile" depends="clean, init">
<echo>Performing compiling</echo>
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="build.classpath"/>
</javac>
</target>
<path id="build.classpath">
<fileset dir="${lib.dir}" casesensitive="no">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="javadoc" depends="compile">
<javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}">
<!-- Define which files / directory should get included, we include all -->
<fileset dir="${src.dir}">
<include name="**"/>
<exclude name="**/resources/**"/>
</fileset>
</javadoc>
</target>
<target name="build" depends="compile">
<jar destfile="${out.dir}/${jar.name}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="Main"/>
</manifest>
</jar>
</target>
<target name="main" depends="compile, build, javadoc">
<description>Main target</description>
</target>
</project>
** is fully "red" in my IDEA (Intellij IDEA.
* is underlined .
But nevertheless it builds using ant -f build.xml. But when I tries to run jar file I am getting next exceptions.
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
.....
.....
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2438)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2413)
at Main.start(Unknown Source)
Update on copying resources using JavaFX ant tasks
There is no folder with fxml, css and other files in my output jar file. If put it manually everything works, how to say ant to exlictly include folder ?
Based on the Java Deployment Tutorial JavaFX Ant Tasks HelloWorld build.xml sample, and modifying it to add a resources directory (which is a sibling to the project src, classes and dist directories). Place your fxml and css in the resources directory to get them included in the jar. The directory structure of the copied files will match the directory structure of the resources directory, so if you just put them in the resources directory with no sub-directories, the files will show up in the root of the jar file (so when you use the resources reference them relative to the root (e.g. FXMLLoader.load(getResource("/main.fxml"))). I made these modifications without testing as I don't use ant for builds anymore.
<property name="build.src.dir" value="src"/>
<property name="build.resources.dir" value="resources"/>
<property name="build.classes.dir" value="classes"/>
<property name="build.dist.dir" value="dist"/>
<target name="default" depends="clean,compile">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${JAVA_HOME}/lib/ant-javafx.jar"/>
<fx:application id="HelloWorldID"
name="JavaFXHelloWorldApp"
mainClass="HelloWorld"/>
<fx:resources id="appRes">
<fx:fileset dir="${build.dist.dir}" includes="HelloWorld.jar"/>
</fx:resources>
<fx:jar destfile="${build.dist.dir}/HelloWorld.jar">
<fx:application refid="HelloWorldID"/>
<fx:resources refid="appRes"/>
<fileset dir="${build.classes.dir}"/>
<fileset dir="${build.resources.dir}"/>
</fx:jar>
. . .
</target>
You likely have a runtime issue not a build issue
It would seem that the application builds fine and you are getting a runtime error trying to run your application, either due to an issue in your application code or because the resources required for execution are not present.
Try a simpler application which does not include any FXML and build and execute that - if that works than either your error was in your application code or in the code which copies the FXML resources to your build package.
On Intellij syntax highlighting of JavaFX Ant tasks
Regarding the "URI is not registered" error in Intellij, that is a bit of a red-herring. It just means that you haven't registered the schema for the fx namespace with Idea, so Idea cannot validate the document (and provide context sensitive code completion on XML tags). As long as you haven't made syntax or structure errors in your XML (which you probably haven't or ant would likely reject it), then you can ignore such error messages if you wish.
You can find more information on this here:
Intellij Idea Help - Referencing DTD or Schema
Note: I don't think Oracle provide a full XML schema for the JavaFX ant tasks, so it will probably not be possible for you to configure Idea to validate the JavaFX ant task elements of your ant build.xml file. However, that should not prevent you from building your application - your best policy is probably to configure Idea to ignore the JavaFX ant tasks XML schema, so it no longer displays annoying and misdirecting red highlights on your build.xml file.
Alternative Technology
You may (or may not) find using the JavaFX Maven plugin or JavaFX Gradle plugin a better solution for you than using the JavaFX Ant Tasks directly.
I have an Ant build.xml file that works just fine on the command line: it compiles, builds the JAR, and I am able to execute the main method from the JAR just fine. The build.xml file references several thirdparty libraries that are scattered here and there. When building the JAR, the script doesn't include all the thirdparty libraries into the JAR itself. Instead, it puts their path into the JAR's manifest. This helps to keep my JAR slim and tidy.
I'd like to be able to edit and debug my project in Eclipse, but I can't find an easy way to do so. I can have my project use the Ant file to build the project, and that seems to work. However, Eclipse is having trouble finding the thirdparty libaries, and thus Eclipse is having two problems:
it shows (in the text editor) lots of compile errors, because
lots of classes are undefined, and
it can't execute the JAR.
I can solve both of the above problems by specifying by hand, in two difference places (i.e., the build path via Properties->Java Build Path->Libraries, and the execution classpath via Run Configurations->Classpath), all the third party libraries. But it seems like I shouldn't have to do this manually, since all the third party libraries are already listed in my JAR's manifest. What am I doing wrong?
Here's my build.xml file:
<!-- Set global properties for this build -->
<property name="src" location="./src" />
<property name="build" location="./build"/>
<property name="dist" location="./dist"/>
<property name="logs" location="./logs"/>
<property name="docs" location="./docs"/>
<property name="jar" location="${dist}/dynamic_analyzer.jar"/>
<property name="lib" location="../../thirdparty/lib"/>
<property name="hive-util" location="../../hive-utils/dist"/>
<property name="hpdb" location="../../hive-db/hpdb/dist"/>
<property name="static" location="../../hive-backend/static_analyzer/dist"/>
<property name="mainclass" value="com.datawarellc.main.DynamicMain"/>
<path id="dep.runtime">
<fileset dir="${lib}" includes="**/*.jar"/>
<fileset dir="${hive-util}" includes="**/*.jar"/>
<fileset dir="${hpdb}" includes="**/*.jar"/>
<fileset dir="${static}" includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${docs}"/>
<delete dir="${logs}"/>
</target>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${logs}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false">
<classpath refid="dep.runtime" />
</javac>
<!-- Debug output of classpath -->
<property name="myclasspath" refid="dep.runtime"/>
<echo message="Classpath = ${myclasspath}"/>
</target>
<target name="jar" depends="compile">
<!-- Put the classpath in the manifest -->
<manifestclasspath property="manifest_cp" jarfile="${jar}" maxParentLevels="10">
<classpath refid="dep.runtime" />
</manifestclasspath>
<jar jarfile="${jar}" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="${mainclass}"/>
<attribute name="Class-Path" value="${manifest_cp}"/>
</manifest>
<zipfileset dir="${src}" includes="**/*.xml" />
</jar>
</target>
You can see that I have third-party libraries in several directories (${lib}, ${hive-util}, ${hpdb}, and ${static}). I use these to create a path called dep.runtime. I then include dep.runtime in the manifest when building my jar. How can I get Eclipse to use the same dep.runtime for the build path and the classpath when executing?
An alternative to perl is to use an embedded groovy task:
<project name="demo" default="eclipse-files">
<property name="src.dir" location="src"/>
<property name="classes.dir" location="build/classes"/>
<path id="dep.runtime">
<fileset dir="${lib}" includes="**/*.jar"/>
<fileset dir="${hive-util}" includes="**/*.jar"/>
<fileset dir="${hpdb}" includes="**/*.jar"/>
<fileset dir="${static}" includes="**/*.jar"/>
</path>
<target name="bootstrap">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/groovy-all.jar" src="http://search.maven.org/remotecontent?filepath=org/codehaus/groovy/groovy-all/2.1.4/groovy-all-2.1.4.jar"/>
</target>
<target name="eclipse-files">
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
<groovy>
import groovy.xml.MarkupBuilder
project.log "Creating .classpath"
new File(".classpath").withWriter { writer ->
def xml = new MarkupBuilder(writer)
xml.classpath() {
classpathentry(kind:"src", path:properties["src.dir"])
classpathentry(kind:"output", path:properties["classes.dir"])
classpathentry(kind:"con", path:"org.eclipse.jdt.launching.JRE_CONTAINER")
project.references."dep.runtime".each {
classpathentry(kind:"lib", path:it)
}
}
}
</groovy>
</target>
<target name="clean">
<delete file=".classpath"/>
</target>
</project>
Notes:
The bootstrap target will download the 3rd party groovy jar (No dependency on perl)
Groovy can access the "dep.runtime" ANT path directly and iterate over its contents
Groovy has excellent support for writing XML files.
The following answer is similar and additionally generates the Eclipse .project file.
Using Apache Ivy with netbeans
I came up with the following workaround, inspired by the link provided by #leeand00.
First, I wrote a simple Perl script (called genClasspath.pl) that generates the .classpath file that Eclipse uses.
#!/usr/bin/perl
use strict;
if (#ARGV != 2) {
print STDERR "Usage: $0 OUTFILE CLASSPATHSTRING\n";
print STDERR "e.g., $0 .classpath path1:path2:path3\n";
exit 1;
}
my $OUTFILE = $ARGV[0];
my $CLASSPATHSTRING = $ARGV[1];
open my $out_fh, '>', $OUTFILE or die "Couldn't open output file: $!";
print $out_fh q{<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build"/>
};
my #libs = split(":", $CLASSPATHSTRING);
foreach my $thisLib (#libs){
print $out_fh " <classpathentry kind=\"lib\" path=\"$thisLib\"/>\n";
}
print $out_fh "</classpath>\n";
Then, I have my build.xml file call this script with the content of dep.runtime:
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false">
<classpath refid="dep.runtime" />
</javac>
<property name="myclasspath" refid="dep.runtime"/>
<exec dir="." executable="../../scripts/genClasspath.pl" os="Linux">
<arg value=".classpath"/>
<arg value="${myclasspath}"/>
</exec>
</target>
The only catch is that I need to run Ant on the command line at least once before I open the project in Eclipse. But when I do, Eclipse is able to compile and execute my project just fine, since the classpath is exactly the same as Ant's.
I'm using build.xml to build my src. However it failed to generate class files without any error message. The full script is
<?xml version="1.0"?>
<project name="auxiliary" basedir="." default="dist">
<property name="src.dir" value="../auxiliary-src/com/nextbio/drugbank"/>
<property name="dist.dir" value="dist"/>
<property name="lib.dir" value="../jboss_config/common_app_jars"/>
<property name="temp.dir" value="temp"/>
<property name="foo_dist.dir" value="../foo/dist"/>
<path id="libs-classpath">
<fileset dir="${foo_dist.dir}">
<include name="foo.jar"/>
</fileset>
</path>
<target name="dist" depends="auxiliary-dist" />
<target name="auxiliary-cleanup">
<delete dir="${temp.dir}"/>
<delete dir="${dist.dir}"/>
<echo message="cleaned up. ${temp.dir}, and ${dist.dir} have been deleted."/>
</target>
<target name ="auxiliary-dist">
<delete dir="${temp.dir}"/>
<echo message="delete ${temp.dir}" />
<mkdir dir="${temp.dir}"/>
<javac destdir="${temp.dir}" source="1.6" target="1.6" debug="on" fork="true" memorymaximumsize="1024m">
<src path="${src.dir}"/>
<classpath>
<path refid="libs-classpath"/>
</classpath>
<include name="com/car/**"/> <!-- troubled line -->
</javac>
<!--<copy overwrite="true" todir="${temp.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
<exclude name="**/*.sql"/>
<exclude name="**/*.txt"/>
</fileset>
</copy>
<delete dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
<jar destfile="${dist.dir}/auxiliary.jar" basedir="${temp.dir}"/> -->
</target>
There is no class file in ${temp.dir} after this step, and no error message. I double checked it, and found it is because of the "troubled line". I tried to add some files to the classpath. I don't know why it is wrong.
The source path should point to the root of the package tree. You make it point to a specific package inside the sources : ../auxiliary-src/com/nextbio/drugbank.
And in the javac task, you ask it to compile all the files matching the pattern com/car/**. That means that it will compile the Java source files in ../auxiliary-src/com/nextbio/drugbank/com/car or in a subdirectory. If that's the case, you have very unconventional package names.
I had the same problem.
My project complilated well but the classes there weren't in nowhere and It didn't have any error message.
My problem was the classpath. The eclipse wizard added EclipseLink 2.5.1 jars.
I removed it and the problem is gone.
I suggest make a simple HelloWord and remove all jars
reference from the classpath and try again.
I encountered this "ant, javac, compile" problem related with the classpath to.
No debug or verbose message shown.
This behavior appear because in classpath exists not compatible (superior) version jar packages and that cause no output classes.
I have the following directory structure of a project:
Folder "project" in Eclipse:
--folder "src"
--folder "resources"
----trayicon2.png
--folder "db"
----test.db
--folder "bin"
I'm accessing the image with:
Image image = Toolkit.getDefaultToolkit().getImage("resources/trayicon2.png");
and from Eclipse that is not a problem.
Then I generate an "executable jar file", and add the dirs, making a directory structure of:
Folder "project"
--folder "db"
----test.db
--folder "resources"
----trayicon2.png
--project.jar
And now the image is no more accessible. Also, the database is no more accessible; while in Eclipse I used to access it with:
Connection conn = DriverManager.getConnection("jdbc:sqlite:db/test.db");
How can I access the resources (images and db) after generating the jar file "project.jar"?
For the image, try this:
URL imageURL = getClass().getResource("/resource/trayicon2.png"); // note leading slash
Image image = Toolkit.getDefaultToolkit().getImage(imageURL);
When you are in eclipse the filename you pass is relative and it is resolved properly with the classpath that is automatically setup by eclipse. Try using the URL version of the method and pass the URL to your jar file. You can see an example on this page
You may want to switch to ANT to build your jar files.
You can have the image resources built into the jar where they can be found, and any required libraries (like those for sqlite, put into a lib folder inside the jar as well).
Here's a sample build file:
<?xml version="1.0"?>
<project name="test" default="compile" basedir=".">
<description>
Generates jar for project
</description>
<property name="src.dir" value="${basedir}/src"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.jars" value="${build.dir}/jars"/>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.jars}"/>
</target>
<path id="core.classpath">
<fileset dir="${build.jars}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id='lib.classpath'>
<fileset dir='lib' />
</path>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.classes}" debug="true">
<classpath refid="lib.classpath"/>
</javac>
</target>
<target name="copy-resources">
<copy todir="${build.classes}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="jar" depends="compile, copy-resources">
<jar destfile="${build.jars}/project.jar">
<fileset dir="${build.classes}">
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.png"/>
</fileset>
<fileset dir=".">
<include name="**/*.jar"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="com.your.path.to.MainClass"/>
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${build.classes}"/>
<delete dir="${build.jars}"/>
</target>
</project>
This assumes you have some java files in a src directory, and some libraries in a lib folder. So your path would look like this:
Project
----------
-bin
-src
--com...
---MainClass (has a main method, runs your program)
---a.png (will be findable)
-lib
--jar files required by your project
build.xml
-----------
It will also copy any properties or png files you have inside the src folders.
You would then type ANT jar at the level of build.xml to build the jar file.
You can't access resources inside a JAR file directly. Instead, you need to use the Class's URL getResource(String) (or InputStream getReourceAsStream(String)) methods.
I'm not really sure how you'd use that with the SQLite database, though.