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

javah does not load Standard Extension jar files automatically

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.0
    • tools
    • sparc
    • solaris_2.6



      Name: skT45625 Date: 06/28/2000


      lowe% java -version
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-beta)
      Java HotSpot(TM) Client VM (build 1.3-beta, mixed mode)


      The javah tool is not paying attention to the Standard Extensions mechanism
      for finding jars. We have Java Advanced Imaging (JAI) installed in our JRE
      environment, and the JAI classes are found just fine via the automatic
      extensions mechanism for the java and javac commands. However, javah is not
      finding the classes; we have to explicitly set CLASSPATH to include the
      extensions directory.

      lowe% more JavahTest.java
      import javax.media.jai.*;
      import java.awt.*;

      class JavahTest extends OpImage {
         public native void junk();

         // Resolve OpImage abstract methods
         public Rectangle mapSourceRect(Rectangle r, int i) { return null; }
         public Rectangle mapDestRect(Rectangle r, int i) { return null; }
         public JavahTest() { super(null, null, null, null, null, null, false); }
      }

      lowe% printenv CLASSPATH
      .
      lowe% javac JavahTest.java
      lowe% javah -jni JavahTest
      Error: Class javax.media.jai.OpImage could not be found.
      lowe% javah -jni -classpath ${CLASSPATH}:/usr/java/jre/lib/ext/jai_core.jar
      JavahTest
      lowe%

      Note the error in the first javah, which is resolved by explicitly including
      the jai_core.jar file in CLASSPATH.

      The problem occurs in 1.2.1 (build Solaris_JDK_1.2.1_04, native threads,
      sunwjit), in 1.2.2, *AND* in the 1.3 beta specified above.
      (Review ID: 106676)
      ======================================================================

            kizune Alexander Zuev
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: