Hi, i'm having problems running the following program can someone please tell me where i'm going wrong?
This is the error i got when running the program
Exception in thread "main" java.lang.Unsat isfiedLinkError : HelloWorld.prin t()V
at HelloWorld.prin t(Native Method)
at HelloWorld.main (HelloWorld.jav a:7)
The java file
The c file
The .h file
This is the error i got when running the program
Exception in thread "main" java.lang.Unsat isfiedLinkError : HelloWorld.prin t()V
at HelloWorld.prin t(Native Method)
at HelloWorld.main (HelloWorld.jav a:7)
The java file
Code:
class HelloWorld
{
private static native void print();
public static void main(String[] args)
{
print();
}
static
{
System.loadLibrary("HelloWorld");
}
}
Code:
#include <jni.h>
#include <stdio.h>
#include "HelloWorld.h"
JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
printf("Hello World!\n");
return;
}
Code:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class HelloWorld */
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: HelloWorld
* Method: print
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif
Comment