Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to "endorse" a library in Java?

Tags:

java

I am a Java newbie and read an article (https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUsrManJavaInstall) which stated that the only known JAXP providers to work are the Apache Xerces & Xalan projects and that I must endorse a different JAXP.

What does it mean to "endorse" a library in Java?

I am most familiar with c/c++/c#. What would the equivalent action be in any of these environments?

like image 762
Thronk Avatar asked Oct 20 '25 13:10

Thronk


1 Answers

Well you may think of a JAR as DLL(mostly, even though they differ in many aspects). And now what happens if two different JARS with same code base but different versions are found in your project(here different version means different Version of the API).

Now this may lead to conflicts. These conflicts are especially pronounced when you are working with Webservices and XML parsers.

So when some Webservice framework asks you to 'endorse' a jar that means you need to put it in your JDK Endorsed folder -

\lib\endorsed [Microsoft Windows] /lib/endorsed [Solaris or Linux]

Here JAVA-HOME is where your JDK is installed.

Caution - This feature should be used carefully and can have unintended consequences.

Further reading -

  • http://docs.oracle.com/javase/1.5.0/docs/guide/standards/index.html
  • what is the exact way to use Endorsed directory in jdk1.6
like image 136
Pushkar Avatar answered Oct 22 '25 02:10

Pushkar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!