Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

Java, MANIFEST file

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
Los Angeles1
Asked:
Los Angeles1
1 Solution
 
dpearsonCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now