Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-12-10
5
Medium Priority
?
666 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 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 39710567
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 21

Expert Comment

by:Amitkumar Panchal
ID: 39710786
0
 
LVL 86

Expert Comment

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

Author Closing Comment

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

Expert Comment

by:mccarl
ID: 39711145
No worries, glad I could help! :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

783 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