Stack Exchange
LibGDX JNIGen (1.7.0) append test to the package
Launching (Run As > Java Application > Foo.java):
public static void main (String[] args) throws Exception {
    NativeCodeGenerator jnigen = new NativeCodeGenerator();
    jnigen.generate("src", "classes", "jni", new String[] {"**/Foo.java"}, null);
    ..
}

Got a FileNotFoundException:
Generating C/C++ for 'src\test\java\bar\Foo.java'...
Command: javah -classpath classes -o jni/test.bar.Foo.h test.bar.Foo
Error: Could not find class file for 'test.bar.Foo'.
Exception in thread "main" java.lang.RuntimeException: Error reading file: jni\test.bar.Foo.h (Absolute)
    at com.badlogic.gdx.jnigen.FileDescriptor.read(FileDescriptor.java:127)
    at com.badlogic.gdx.jnigen.FileDescriptor.readString(FileDescriptor.java:176)
    at com.badlogic.gdx.jnigen.FileDescriptor.readString(FileDescriptor.java:166)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.generateCppFile(NativeCodeGenerator.java:303)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:267)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:245)
    at com.badlogic.gdx.jnigen.NativeCodeGenerator.generate(NativeCodeGenerator.java:236)
    at bar.Build.main(Build.java:14)
Caused by: java.io.FileNotFoundException: jni\test.bar.Foo.h (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at com.badlogic.gdx.jnigen.FileDescriptor.read(FileDescriptor.java:123)
    ... 16 more

Problem, JNIgen is appending test to my package name bar. So instead of bar, jnigen is looking for test.bar. But:

My classpath (Eclipse) point to acme/src/test/resources 
Maven build my project (others classes) without any problems

Any idea? Using Java 7u80

For those facing the same compilation issue, fixed as below.
Still, executing Foo will produce the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Foo.add(II)I
    at Foo.add(Native Method)
    at Foo.main(Foo.java:14)

Using then static { System.load(filename); } or static { System.loadLibrary(libname); } won't fix the problem.
And reading it from as with Foo neither.
Any help would be appreciated. Opened this bug 

package bar;

import com.badlogic.gdx.jnigen.AntScriptGenerator;
import com.badlogic.gdx.jnigen.BuildConfig;
import com.badlogic.gdx.jnigen.BuildExecutor;
import com.badlogic.gdx.jnigen.BuildTarget;
import com.badlogic.gdx.jnigen.BuildTarget.TargetOs;
import com.badlogic.gdx.jnigen.NativeCodeGenerator;

public class Build {

    public static void main (String[] args) throws Exception {
        NativeCodeGenerator jnigen = new NativeCodeGenerator();
        jnigen.generate("src\\test\\java", "test-classes", "jni", new String[] {"**/bar.Foo.java"}, null);
        BuildTarget win64 = BuildTarget.newDefaultTarget(TargetOs.Windows, true);
        new AntScriptGenerator().generate(new BuildConfig("foo"), win64);
        ..
    }
}

package bar;

import com.badlogic.gdx.jnigen.JniGenSharedLibraryLoader;

public class Foo {
    // @off

    static public native int add (int a, int b); /*
        return a + b;
    */

    public static void main (String[] args) throws Exception {
        //load foo64.dll from libs/foo-natives.jar
        new JniGenSharedLibraryLoader().load("foo"); 
        System.out.println(add(1, 2));
    }
}

MinGW 32 bit and MinGW 64 bit must both be installed (even if I'm on x64) and their bin directory must be in the PATH env. var.
See JNIGen site for more info.
