 <p>I think it's simply a bug in how the <code>javah</code> outputs its actual classpath. What happens is that it has a bunch of places where it searches for built-in classes, and apart from them, it also uses the stuff in <code>$CLASSPATH</code>. When it prints the actual classpath used, they do something like this (pseudo code, assuming <code>implicitEntries</code> is a list of builtin classpath entries, and <code>explicitEntries</code> is a list of the the directories specified in <code>$CLASSPATH</code>):</p> <pre><code>print implicitEntries.join(pathSeparator) + explicitEntries.join(pathSeparator) </code></pre> <p>where it should have been</p> <pre><code>print implicitEntries.join(pathSeparator) + pathSeparator + explicitEntries.join(pathSeparator) </code></pre> <p>The following works fine for me:</p> <pre><code>$ ls Sasl.class Sasl.java $ javah -classpath . -o javasasl.h -jni -verbose Sasl [ Search Path: /usr/java/jdk1.6.0/jre/lib/resources.jar:/usr/java/jdk1.6.0/jre/lib/rt.jar:/usr/java/jdk1.6.0/jre/lib/sunrsasign.jar:/usr/java/jdk1.6.0/jre/lib/jsse.jar:/usr/java/jdk1.6.0/jre/lib/jce.jar:/usr/java/jdk1.6.0/jre/lib/charsets.jar:/usr/java/jdk1.6.0/jre/classes/. ] [Creating file javasasl.h] [search path for source files: [.]] [search path for class files: [/usr/java/jdk1.6.0/jre/lib/resources.jar, /usr/java/jdk1.6.0/jre/lib/rt.jar, /usr/java/jdk1.6.0/jre/lib/sunrsasign.jar, /usr/java/jdk1.6.0/jre/lib/jsse.jar, /usr/java/jdk1.6.0/jre/lib/jce.jar, /usr/java/jdk1.6.0/jre/lib/charsets.jar, /usr/java/jdk1.6.0/jre/classes, /usr/java/jdk1.6.0/jre/lib/ext/dnsns.jar, /usr/java/jdk1.6.0/jre/lib/ext/localedata.jar, /usr/java/jdk1.6.0/jre/lib/ext/sunpkcs11.jar, /usr/java/jdk1.6.0/jre/lib/ext/sunjce_provider.jar, .]] [loading ./Sasl.class] [loading /usr/java/jdk1.6.0/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)] [loading /usr/java/jdk1.6.0/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Throwable.class)] [loading /usr/java/jdk1.6.0/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Class.class)] [done in 585 ms] $ ls javasasl.h Sasl.class Sasl.java </code></pre> <hr> <p>Now, since the header file generation doesn't seem to work for you... are you sure you have <code>Sasl.class</code> in the current directory? <code>javah</code> works with byte code files, not Java source files.</p>