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)
======================================================================