Solved

Java, MANIFEST file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
json example 39 130
Where to store the queries for modification of table 4 52
xampp tool 12 21
servlet example issue 6 27
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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 …

939 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

6 Experts available now in Live!

Get 1:1 Help Now