Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4615364

java.ext.dirs should be at least two dirs to segregate optional packages

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • generic
    • generic

      Name: pa48320 Date: 12/18/2001

      Optional packages should not install in same directory as JRE standard
      extensions.

      Prior to 1.4, Javasoft did not ship any standard extensions in
      jre/lib/ext. In 1.4, the JRE comes with:

          dnsns.jar
          jgss_kerberos.jar
          ldapsec.jar
          sunjce_provider.jar

      However, Optional Packages installed by applets also install jar files
      in this same directory. This makes it impossible for a Java application
      to ensure a consistent, clean deployment run time environment. Prior to
      1.4, we could run Java applications with

         java -Djava.ext.dirs= com.sas.myapp.Main

      and this insulate the application from any jars downloaded by applets
      using the Optional Package specification. If we launch 1.4-based
      applications using this runtime option, these new jars will not be
      available.

      Optional Package jars downloaded by applets will also cause a
      performance problem for non-applet applications which use the same JRE.
      For example, when an application loads a resource such as a class or
      resource bundle, the application classloader will first delegate to the
      extension class loader (which in turn delegates to tbe boot class
      loader). The extension class loader will then try to find that resource
      in all the optional package jars.

      To fix this, java.ext.dirs should be two separate directories

          jre/lib/standard-ext

               would contain dnsns.jar, jgss_kerberos.jar, ldapsec.jar,
               sunjce_provider.jar, and other jar files Javasoft
               or JVM vendors wish to ship with their JRE.
               
          jre/lib/optional-packages

               would contain jars downloaded by the applet Optional Package
               specification.
               
      Further, the extension directory path used by the Java tools (java,
      javadoc, javap, javaws, web servers, etc.) would be

          -Djava.ext.dirs=JAVA_HOME/jre/lib/standard-ext

      and the java.ext.dirs used by the plug in would be

          -Djava.ext.dirs=JAVA_HOME/jre/lib/standard-ext;JAVA_HOME/jre/lib/optional-packages;

      Thus, applications could run in a clean environment, not polluted by
      applet Optional Package installed jars.

      ======================================================================

            mchung Mandy Chung (Inactive)
            pallenba Peter Allenbach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: