Forums Register Login

How does my program see a Class in a JAR when the JAR is not in the CLASSPATH?

+Pie Number of slices to send: Send
Using JDeveloper, I created a Web Service Proxy project to consume a WSDL. Doing so downloaded/created a bunch of Java classes.
After some finishing touches, I ran it inside JDeveloper and it works.

Some of the code uses a class called SecurityPolicyFeature. And for learning purposes, I am curious how it "sees" that class.
I added:

It told me where the JAR is:


The thing I don't understand is, how does it "see" ws.api_1.1.0.0.jar?
Its not in my Windows environment variable classpath.
When the project was setup (through a JDeveloper Wizard for Web Proxies) it apparently loaded some JAR files as libraries. But, ws.api_1.1.0.0.jar is not one of them.
Some of the JAR files that are attached as libraries have a file like: META-INF/MANIFEST.MF
I gather that MANIFEST.MF can have CLASSPATH variables pointing to other JAR files?

How can I tell if one of these MANIFEST.MF files points to the ws.api_1.1.0.0.jar? Or worse, a MANIFEST.MF points to a JAR with a MANIFEST.MF, which points to a JAR with a MANIFEST.MF, etc, etc, until finally it points to ws.api_1.1.0.0.jar?
How does one untangle the web?

Thanks,
Arie
+Pie Number of slices to send: Send
You could take a look at this page: http://www.kirkk.com/main/Main/JarAnalyzer
+Pie Number of slices to send: Send
 

Its not in my Windows environment variable classpath.



Generally speaking, servlet containers such as Tomcat do not use the environment variable classpath.

See typical class loader howto docs.

Bill
+Pie Number of slices to send: Send
 

William Brogden wrote:
Generally speaking, servlet containers such as Tomcat do not use the environment variable classpath.



I would argue that no Java app should be using the CLASSPATH environment variable.
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 517 times.
Similar Threads
Get the path to a jar file
Reading from a file located in same folder as my JAR file.
Different reults of execution of jar from terminal and by double clicking
JBoss JSP compilation
How to run .jar if pc doesnt have the java library environment variables set
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:08:38.