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.

[2192 byte] By [gohan_iitda] at [2007-11-27 11:40:25]
# 1

sorry in System.out.println("its k" ).. any way I am sure this line is not creating a problem.. infact I am using this k for smthg else.. just for help i have put this line System.out.println("its k" )

gohan_iitda at 2007-7-29 17:31:46 > top of Java-index,Java Essentials,Java Programming...
# 2

<snip>

> l 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

See bug report:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6515362

Niceguy1a at 2007-7-29 17:31:46 > top of Java-index,Java Essentials,Java Programming...