How does one compares to the other? I have an embedded application that if compiled and archived into a .jar with the regular Eclipse export tool will work fine in my emulator and subsequently, in the device itself. Now I’m trying to use the command line jar tool to the same effect but I’m stuck. The .jar file is created and I can even install it fine in the emulator, but when I try to run, nothing happens.
Due to my experience with this emulator/device, I reckon its a problem lying on the .jar file generated by the command line tool. I don’t use any kind of “compilation parameter” so to speak with Eclipse except for the manifest file, which I also add with the command line tool. Besides, there’s “some” compression using Eclipse, whereas the command line tool generates an even more compressed file (or not compressed at all using the -0 parameter, but none worked).
Well, it all made me wonder how the Eclipse archiving tool works and if there’s a way to obtain the same results with the command line tool – I know, I know, it does sound stupid, but so is the damn emulator.
Not that I consider relevant, but the jar command I’m using is this:
jar cmfv0 34092040.mf Releaser.jar -C src . (output file size: 140kb)
or
jar cmfv 34092040.mf Releaser.jar -C src . (output file size: 53kb)
Eclipse outputs a 81kb file.
EDIT: Please close this question. The problem is my giant stupidity (I forgot to COMPILE the files before archiving them u.u)
Eclipse may be creating a different structure inside its archive, e.g. including dependencies or such. Are there any dependent projects or third-party jars being used?
If the code in the jar is going to depend on an external jar, you can add an entry in the manifest.mf file for each dependent jar. What is supposed to happen is the runtime checks the manifest and gives a more specific error; something like “Can not find jar: xyz.jar” which reminds you to add it to the classpath.