Javah command for native methods gives Exception [closed]
I entered this into command prompt and I'm not sure why it is saying that it is not a valid class name considering that it has the position on the disk and the fully qualified class name. Java - version works and I'm running the latest version of the JVM with the JDK, also the CLASSPATH is configured properly.
The class is this:
package JNI;
public class Main {
public native void printTitle();
public static void main(String[] args) {
Main main = new Main();
main.print();
}
public void print(){
System.out.println("The print subroutine has finished.");
}
And the command line args are:
C:\Users\USER\Documents\NetBeansProjects\JNI Test Project\build\classes\JNI>javah -jni -classpath "C:\Users\USER\Documents\NetBeansProjects\JNI Test Project\build\classes\JNI" JNI.Main.class
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: JNI.Main.class
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:177)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:509)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:335)
at com.sun.tools.javah.Main.main(Main.java:46)