Solved

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

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

739 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