この質問は、この質問とその回答に関連しています。
int.class は Java の Integer.class または Integer.TYPE と同じですか?
int.class は Integer.class と等しくないため、JNI を介してネイティブ レベルで int.class Class またはその他のプリミティブ型を取得するにはどうすればよいですか? Integer.class ではなく int.class を指す jclass オブジェクトが必要です。
この質問は、この質問とその回答に関連しています。
int.class は Java の Integer.class または Integer.TYPE と同じですか?
int.class は Integer.class と等しくないため、JNI を介してネイティブ レベルで int.class Class またはその他のプリミティブ型を取得するにはどうすればよいですか? Integer.class ではなく int.class を指す jclass オブジェクトが必要です。
This test
System.out.println(Integer.TYPE == int.class);
prints true. That is, Integer.TYPE is what you want, you can read Integer.TYPE field from native code. Or call Class.getPrimitiveClass("int") from native code
JNI では、プリミティブ値は実際のマシン値として渡されます。int は、32 ビットの符号付き整数に typedef された jint として渡されます。
http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html#wp9502