please help me (JNI method)
Hi here's Getch.java
publicclass Getch{
// private Getch(){}
publicstaticnativeint getch();
publicstaticvoid main(String[] args){
char k = (char)new Getch().getch();
System.out.prinln( +key ) ;
}
static{System.loadLibrary("Getch");}
}
Getch.c file
#include<stdio.h>
#include<jni.h>
#include"Getch.h"
JNIEXPORT jint JNICALL Java_Getch_getch(JNIEnv *env, jclass lass )
{
return getch();
}
compilation command
javac Getch.java
javah -jni Getch
gcc -o libGetch.so -shared -Wl,-soname,libGetch.so -I /opt/jdk1.5.0_11/include/ -I /opt/jdk1.5.0_11/include/linux/ Getch.c -static -lc
all thing going the way I expect..but when i try to run
java Getch
it gives error as Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/raj/tmp/dump/jni/libGetch.so: Can't load IA 32-bit .so on a IA 32-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at Getch.<clinit>(Getch.java:9)
i am not sure where i am wrong.. please help me its urgent for me..
Thanks in advance.

