Solved

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

Posted on 2013-12-10
5
620 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
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 35

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 83
Where to store the queries for modification of table 4 55
servlet requestdispatcher include and forward differences 1 25
MySQL  on Tomcat 8 30
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

864 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

21 Experts available now in Live!

Get 1:1 Help Now