Solved

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

Posted on 2013-12-10
5
611 Views
Last Modified: 2013-12-11
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?
0
Comment
Question by:efamilant
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
Comment Utility
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
 
LVL 20

Expert Comment

by:Amitkumar Panchal
Comment Utility
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
You could just add an Ant task to update the manifest only
0
 

Author Closing Comment

by:efamilant
Comment Utility
Fat jar works great.  It's exactly what I needed and it was pretty easy to install.  Thank you.
0
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
No worries, glad I could help! :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now