Java Endorsed Standards Override Mechanism - introduction

Normally, Java platform library are developed under Java Community Process(Endorsed Standards) and all libraries are released with JDK standards.

From time to time it is necessary to update the Java platform in order to incorporate newer versions of standards that are created outside of the Java Community Process(Endorsed Standards), or in order to update the version of a technology included in the platform to correspond to a later standalone version of that technology (Standalone Technologies).

Java supports a mechanism called the "Endorsed Standards Override Mechanism" to allow replacement of APIs created outside of the JCP (i.e. DOM and SAX from W3C). The Endorsed Standards Override Mechanism provides a means whereby later versions of classes and interfaces that implement Endorsed Standards or Standalone Technologies may be incorporated into the Java Platform.
  • Endorsed Standard in JDK
The system property java.endorsed.dirs specifies one or more directories that the Java runtime environment will search for such JAR files. If more than one directory path is specified by java.endorsed.dirs, they must be separated byFile.pathSeparatorChar(On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'). If no value is set for java.endorsed.dirs, then Sun Microsystem's implementation of the Java platform looks for JAR files in a default standard location:
<java-home>\lib\endorsed          [Microsoft Windows]
<java-home>/lib/endorsed          [Solaris or Linux]
Here <java-home> refers to the directory where the runtime software is installed (which is the top-level directory of the Java SE Runtime Environment or the jre directory in the JDK).
The Java SE runtime environment will use classes in such JAR files to override the corresponding classes provided in the Java platform as it was shipped.
  • Endorsed Standard in Tomcat, Tomee
Tomcat utilizes this mechanism by including the system property setting -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS in the command line that starts the container. The default value of this option is $CATALINA_HOME/endorsed. This endorsed directory is not created by default.

Reference: 
https://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html 
https://docs.oracle.com/javase/7/docs/technotes/guides/standards/

No comments :

Post a Comment