Endorsed

After writing my last post we had a short discussion about the endorsed directory and I realized I had neither fully explained the concept nor did I provide enough reference material so that it could be easily understood.

This page from Java 6 documentation technical notes explains it nicely.  The idea is you have a jar file which contains classes that you know should be used in place of the ones which are part of a particular version of Java.

When I explained this in that short conversation I included the word "hack" because I was trying to convey the mess we may be creating:
  • there is the very real possibility that other applications will be impacted because we are changing the Java runtime
  • if Java is upgraded the "fixed" application may break again and the "fix" may be forgotten
The bottom line is while I am glad Java has a convenient way to replace classes, I liken it to what I was taught about sudo'ing on Unix/Linux.  Respect it, use it sparingly, and don't forget when it's in use.

:)
Post a Comment

Popular posts from this blog

ClassCastException: JAXB

JDeveloper installation on Mac OS X Mountain Lion

Android and JavaFX