I think using
ANT you can solve it.
As you know using build file can make use of jar file.
Here is a sample program in ANT. I am just tyring, it is not sure. Anyway try...
Description:
Here I have a file called "Hello.java" and it is inside "D:\AnT".
So change it with your file name and directory path to the specified file.
create a build file using this and
1) type -> ant compile
2) type -> ant jar
3) type -> ant run
or replace all with
ant compile jar run
Code is:
<project>
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac srcdir="D:\AnT" destdir="build/classes"/>
</target>
<target name="jar">
<mkdir dir="build/jar"/>
<jar destfile="build/jar/Hello.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="Hello"/>
</manifest>
</jar>
</target>
<target name="run">
<java jar="build/jar/Hello.jar" fork="true"/>
</target>
</project>
Note:
I am new to ANT, so please forgive me if any mistake