Solved

Java, MANIFEST file

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
simple java question 3 59
varialbe initialization 11 37
jboss wildfly 10.1 10 228
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 43
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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 …

839 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