problem loading library

Hi there.

I'm trying to load a library by -Djava.library.path=path_to_lib but get error message saying java.lang.UnsatisfiedLinkError.

I'm doing it this way because I'm trying to write a midlet.

So the questions are: Is this possible in a midlet and

if possible what am i doing wrong:

My java code is:

class Hello

{

publicnativevoid sayHello();

publicstaticvoid main(String[] args)

{

Hello h =new Hello();

h.sayHello();

}

}

C code is:

#include <jni.h>

#include"Hello.h"

#include <stdio.h>

#include <math.h>

JNIEXPORTvoid JNICALL Java_Hello_sayHello (JNIEnv *env,

jobject obj)

{

printf("Hello world!\n");

}

My def-file is:

EXPORTS

Java_Hello_sayHello

and my makefile is.

all : Hello.dll

Hello.dll : Hello.o Hello.def

gcc -shared -o Hello.dll Hello.o Hello.def

Hello.o : Hello.c Hello.h

gcc -I"C:\Program Files\Java\jdk1.6.0_01\include" -I"C:\Program Files\Java\jdk1.6.0_01\include\win32" -c Hello.c -o Hello.o

Hello.h : Hello.class

javah -jni Hello

clean :

-del Hello.h

-del Hello.o

[1797 byte] By [alan_SEa] at [2007-11-27 9:25:20]
# 1
You have to explicitly load the library using a System.loadLibrary() call. The commandline input you defined simply tells the JVM from whence to load any libraries.
bschauwejavaa at 2007-7-12 22:21:55 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
That would be an easy task if System.loadlibrary was available in CLDC. Is there any other way?thanks
alan_SEa at 2007-7-12 22:21:55 > top of Java-index,Java HotSpot Virtual Machine,Specifications...