Altering the default header of the Manifest when exporting a runnable jar file in eclipse

When I create a runnable jar file in Eclipse, the IDE automatically generates a manifest, the first three lines are:

Manifest-Version: 1.0
Class-Path: .
Main-Class: MyMainClass
What I want to do is add a fourth line

Caller-Allowable-Codebase: *
and then have Eclipse add in all the other stuff it does when creating a runnable jar file.

Currently, I have to manually open the jar and insert the line myself. Any way to change a setting in Eclipse to get it to do this automatically?
efamilantAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mccarlConnect With a Mentor IT Business Systems Analyst / Software DeveloperCommented:
The in-built "Export Runnable JAR" option doesn't support any customizations to the MANIFEST.MF file (as far as I know).

You could try using the FatJar plugin, which basically does exactly the same job as the inbuilt exporter but has a few more options...

http://fjep.sourceforge.net/

The tutorial page (from the link above) shows that it has options to merge MANIFEST sections, so you should be able to create a stub manifest file with the options that you need, and have the plugin merge in what it creates in order for it to be runnable.
0
 
Amitkumar PSr. ConsultantCommented:
0
 
CEHJCommented:
You could just add an Ant task to update the manifest only
0
 
efamilantAuthor Commented:
Fat jar works great.  It's exactly what I needed and it was pretty easy to install.  Thank you.
0
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
No worries, glad I could help! :)
0
All Courses

From novice to tech pro — start learning today.