title: Android, generate jni Header Files with javah , show error that can't find org.opencv.core.Mat
body: <p>I just have an annoying problem with jni when i compile the native method in java class with <code>javah</code> to generate JNI header files. </p>
  
  <p>If the class has used 3rd-party package, For example: org.opencv.core.Mat, then the <code>javah</code> will show the error that can't find the org.opencv.core.Mat class.</p>
  
  <p>The OpenCV sample code as below:</p>
  
  <pre><code>package org.opencv.samples.fd;
  
  import org.opencv.core.Mat;
  import org.opencv.core.MatOfRect;
  
  public class DetectionBasedTracker
  {
  public DetectionBasedTracker(String cascadeName, int minFaceSize) {
      mNativeObj = nativeCreateObject(cascadeName, minFaceSize);
  }
  
  public void start() {
      nativeStart(mNativeObj);
  }
  
  public void stop() {
      nativeStop(mNativeObj);
  }
  
  public void setMinFaceSize(int size) {
      nativeSetFaceSize(mNativeObj, size);
  }
  
  public void detect(Mat imageGray, MatOfRect faces) {
      nativeDetect(mNativeObj, imageGray.getNativeObjAddr(), faces.getNativeObjAddr());
  }
  
  public void release() {
      nativeDestroyObject(mNativeObj);
      mNativeObj = 0;
  }
  
  private long mNativeObj = 0;
  
  private static native long nativeCreateObject(String cascadeName, int minFaceSize);
  private static native void nativeDestroyObject(long thiz);
  private static native void nativeStart(long thiz);
  private static native void nativeStop(long thiz);
  private static native void nativeSetFaceSize(long thiz, int size);
  private static native void nativeDetect(long thiz, long inputImage, long faces);
  }
  </code></pre>
  
  <p>First, I used the command </p>
  
  <pre><code>javah -classpath bin/classes -bootclasspath (the directory of android.jar) -d jni (packageName + ClassName) , shows the error "can't find the org.opencv.core.Mat
  </code></pre>
  
  <p>Then I modified the command to </p>
  
  <pre><code>javah - classpath bin/classes - bootclasspath (the dir of android.jar) ; (the dir of the opencv lib jar)  -d jni ..." ", this time it shows error
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class
   name: E:\Computer_Language\Java\soft_android\OpenCV-2.4.3-rc-android-sdk\OpenCV
  -2.4.3-rc-android-sdk\sdk\java\bin\opencv library - 2.4.3.jar
      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)
  </code></pre>
  
  <p>I think, adding the directory of opencv lib in <code>-bootclasspath</code> is useful and neccessary. The error is because i just added two path in <code>-bootclasspath</code> or the format is something wrong?</p>
  
  <p>Really confused.
  Please give some help , thank u!</p>