Solved

Java, MANIFEST file

Posted on 2014-01-15
1
422 Views
Last Modified: 2014-01-16
Can I put in references to objects within the manifest of a master jar file that are not used:

For instance:

Manifest-Version: 1.0 Rsrc-Class-Path: ./ a.a blb clc

Open in new window


1> If objects with the a.a and b.b are never used or referred to by the master jar file, will the jar file still work

2? If I do reference an object (say a jar file) that contains a needed method, would the master jar file then look to the sys CLASSPATH
0
Comment
Question by:Los Angeles1
1 Comment
 
LVL 27

Accepted Solution

by:
dpearson earned 500 total points
ID: 39784578
1> If objects with the a.a and b.b are never used or referred to by the master jar file, will the jar file still work

Yes that should be fine.

2? If I do reference an object (say a jar file) that contains a needed method, would the master jar file then look to the sys CLASSPATH

For Java the normal model is to place all of the needed JARs either in the Manifest explicitly or in a specific folder for a web server (like tomcat) and not use a manifest at all.  I believe if you specify a class path in the Manifest it overrides the system CLASSPATH variable, but because Java class loading involves a chain of class loaders it will still look for some classes in the system libraries.  The whole chain is shown here:
http://javarevisited.blogspot.com/2012/12/how-classloader-works-in-java.html

Hope that helps a bit - unfortunately it's a very complex area in Java.

Doug
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

679 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