jni.h: no hay tal archivo o directorio


Estoy usando Code::Blocks en windows.

He creado un proyecto dll tratando de obtener alguna práctica JNI.

En mi .archivo h generado por javah ,hay # incluir jni.h, pero cuando intento compilarlo, sigue diciendo jni.h: no hay tal archivo o directorio.

Creo que tiene algo que ver con classpath, ¡pero no se lo que es! Probablemente es la configuración que tengo que cambiar en Code:: Blocks

¿Podría alguien ayudarme a arreglarlo? muchos gracias

/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Vector3D */

#ifndef _Included_Vector3D
#define _Included_Vector3D
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     Vector3D
 * Method:    magnitude
 * Signature: ()D
 */
JNIEXPORT jdouble JNICALL Java_Vector3D_magnitude
  (JNIEnv *, jobject);

/*
  * Class:     Vector3D
 * Method:    mult
 * Signature: (LVector3D;I)LVector3D;
 */
JNIEXPORT jobject JNICALL Java_Vector3D_mult
  (JNIEnv *, jobject, jobject, jint);

/*
 * Class:     Vector3D
 * Method:    equals
 * Signature: (LVector3D;)Z
 */
JNIEXPORT jboolean JNICALL Java_Vector3D_equals
  (JNIEnv *, jobject, jobject);

/*
 * Class:     Vector3D
 * Method:    dotProduct
 * Signature: (LVector3D;LVector3D;)D
 */
JNIEXPORT jdouble JNICALL Java_Vector3D_dotProduct
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     Vector3D
 * Method:    makeNormalized
 * Signature: (LVector3D;)LVector3D;
 */
JNIEXPORT jobject JNICALL Java_Vector3D_makeNormalized
  (JNIEnv *, jclass, jobject);

/*
 * Class:     Vector3D
 * Method:    crossProduct
 * Signature: (LVector3D;LVector3D;)LVector3D;
 */
JNIEXPORT jobject JNICALL Java_Vector3D_crossProduct
  (JNIEnv *, jclass, jobject, jobject);

#ifdef __cplusplus
}
#endif
#endif

EDITAR:
Así que hice Settings Settings > Compiler and debugger directories>Search directories!>and agreed"! (JAVA_HOME)\include" and"! (JAVA_HOME)\include\win32" under Compiler, and it was able to find it!

Author: Leshi Wang, 2012-11-20

1 answers

Debe agregar la ruta JDK a la ruta de inclusión, para que el compilador conozca la ubicación del archivo.

Ventanas:

/I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32"

Linux:

-I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux"

Mac:

-I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/darwin"
 34
Author: Naytzyrhc,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-28 13:04:32