I need to produce a jar file that will be used by others as a library (lets call it 'myLib.jar'), thus the jar does not need to be executable. The library depends on some other 3rd-party jars but i will not expect from the ones who use 'myLib.jar' to include them in his/hers Buildpath.
While searching, i found OneJar and followed the 2 steps at the top of the page.
1. Download one-jar-appgen-0.97.jar
Generate application, build, and run it.
$ java -jar one-jar-appgen-0.97.jar
2. Enter project path (project name is last segment): c:/tmp/test-one-jar
Enter java package name: com.example.onejar
$ cd c:/tmp/test-one-jar
$ ant
$ cd build
$ java -jar test-one-jar.jar
test_one_jar main entry point, args=[]
test_one_jar main is running
test_one_jar OK.
Add source code to the src directory, library jars to the lib directory, and rebuild.
Unfortunately, this did not worked for me since when i tried to include 'myLib.jar' in a new project, i was not able to use the expected classes.
So...
Q1: Is OneJar intended only for executable jars? If not how could i achieve what i have described above.
Q2: If OneJar is intended only for executables, is there another way to produce the 'myLib.jar' library?
PS: If there is a need to add more information please let me know, in order to edit my quetsion.