Generating header file
Hi Comrades! I have a problem generating a C/C++ header file from a class file
Look at this simple program:
package com.mypkg;
class DisplayResult
{
public static native int getValues();
public static native String getName();
public static void main(String[] args)
{
new DisplayResult().getValues();
new DisplayResult().getName();
}
static
{
System.loadLibrary("DisplayResult");
}
}
This compiles successfully to a class file. But when I try to generate a header file using this command:
javah -jni DisplayResult
this is what I get:
C:\Trials\trialJava\com\mypkg>javah -jni DisplayResult
error: cannot access DisplayResult
bad class file: .\DisplayResult.class
class file contains wrong class: com.mypkg.DisplayResult
Please remove or make sure it appears in the correct subdirectory of the classpath.
com.sun.tools.javac.util.Abort
at com.sun.tools.javac.comp.Check.completionError(Check.java:169)
at com.sun.tools.javadoc.DocEnv.loadClass(DocEnv.java:149)
at com.sun.tools.javadoc.RootDocImpl.<init>(RootDocImpl.java:77)
at com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:156)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:330)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:66)
at com.sun.tools.javah.Main.main(Main.java:147)
javadoc: error - fatal error
2 errors
Please can anyone help me get out of this mess!

