2

For Java 7 I have to update my runnable jar (for web start) so the manifest have to include the permissions tag. So I created a META-INF folder under /src and put my MANIFEST.MF file in there. Exporting the project with Export -> Runnable JAR just overwrites my manifest with the useless default one ...

Next step was to use the Export -> JAR where no external libraries were included (like the opencmis libraries from apache) no matter which options I used. This jar can not work.

Last step was to let the build.xml be created from the first step and I added the manifest tags in the build.xml by hand and run the ant build. This was working, but now in the META-INF folder of the Jar I have 5 LICENSE files, 5 NOTICE files and 5 DEPENDENCIES files. I am not able to sign this jar because all those files have the same name.

To make it clear, I want:

  • include custom MANIFEST.MF
  • Extract required libraries into generated JAR to inflate the referenced jar files and copy the classes into the generated jar

With eclipse export wizzards, there is no way to achieve BOTH behaviors!

So can anybody tell me how I can add the permissions tag into the manifest, build a Runnable JAR with all needed libraries and sign the jar?

Thank you all! Michael

Pali
  • 1,337
  • 1
  • 14
  • 40

1 Answers1

0

When exporting, you can flag "use existing manifest".

Manu
  • 4,019
  • 8
  • 50
  • 94
  • 2
    Using Eclipse Kepler and Luna, I dont have the option to 'Use existing manifest' with the 'Runnable JAR Export Wizzard'. This option is only available in the 'JAR Export Wizzard' where I dont can include external libraries like the apache opencmis libs. – Pali Sep 25 '14 at 10:32
  • References to external libraries/JAR files must be specified in the manifest file. Then they will be reasonable included. – Manu Sep 25 '14 at 10:44
  • And how can I tell the exporter to extract libraries so only the needed class files are in the JAR? with the library jars my Jar is about 9mb big, with extracted library class files only 1mb. And why in gods sake cant the 'Runnable Jar Export Wizzard' use my custom manifest and overwrites it? That just dont makes sense? – Pali Sep 25 '14 at 10:47
  • Take a look at this: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-37.htm – Manu Sep 25 '14 at 10:49
  • 1
    Do you see any step/option where I can choose my own manifest file? Sorry but I am frustrated why things are alyways have to be so complicated :/ – Pali Sep 25 '14 at 10:55
  • I understand your frustration, but I am actually doing it with my environment just by following the guide. What about attempting a command line export? On which OS are you working? – Manu Sep 25 '14 at 10:56
  • I mean, steps 2 and 3 of this guide is what I am doing: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-export-runnable-jar.htm – Manu Sep 25 '14 at 10:58
  • I am on Windows 7. Yes exporting my project as a runnable jar is no problem, the problem is that I can not use this jar as web start application because it requires the permissions tag in the manifest (since Java 7). But I have not found an easy way to do this yet. – Pali Sep 25 '14 at 11:01