Solved

Java, MANIFEST file

Posted on 2014-01-15
1
401 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 26

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 49
array6 challenfge 6 65
Python Assistance 7 36
eclipse compiler vs Installed JREs option 3 42
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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:

746 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

13 Experts available now in Live!

Get 1:1 Help Now