Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
657 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

719 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