Hi all<br><br>I'm trying to use JNI with Kaffe but i've encountering some problems<br><br>It's seems that my .so library to be found but when i'm using the main class, i've got the following error:<br><br>
<div style="margin-left: 40px;"># java fr.ptv.valence.katolecho.cannative.CanNative<br>java.lang.NoSuchMethodError: main<br> at java.lang.VMThrowable.fillInStackTrace (VMThrowable.java:native)<br> at java.lang.VMThrowable.fillInStackTrace
(VMThrowable.java:79)<br> at java.lang.Throwable.fillInStackTrace (Throwable.java:498)<br> at java.lang.Throwable.<init> (Throwable.java:159)<br> at java.lang.Error.<init> (Error.java:81)<br> at java.lang.LinkageError
.<init> (LinkageError.java:72)<br> at java.lang.IncompatibleClassChangeError.<init> (IncompatibleClassChangeError.java:71)<br> at java.lang.NoSuchMethodError.<init> (NoSuchMethodError.java:72)<br></div>
<br>To check if my .java and the librairy were bugless, i've just tried it with succeed under win2K and JDK1.6<br><br>The Java file is the following:<br><br><div style="margin-left: 40px;">package fr.ptv.valence.katolecho.cannative
;<br><br>public class CanNative {<br> char[] sentpaquet = new char[14];<br> char[] recievedpaquet = new char[14];<br> static {<br><br> if(System.getProperty ("<a href="http://os.name">os.name</a>").equals("Linux"))
<br> System.loadLibrary("CanNative");<br> else System.loadLibrary("libCanNative"); }<br> <br> public static void ThisIsATest(){<br> System.out.println("This Is a test");
<br> }<br> public native void printInfoRevision();<br> <br> public native char InitCan();<br> public native char CloseCan();<br> public native char SendCan(char[] sentpaquet);<br> public native String ReceiveCAN(String recievedpaquet, int nombre_de_paquets);
<br> public native int isBusOffCAN();<br> public native void PrintLastErrorCAN();<br> public native void CanBusFailed();<br> public native void CanReset();<br> public native int GetRxErr();<br> public native int GetTxErr();
<br> public native int GetSpeedCAN();<br> public native void CanTest();<br> public native void CloseStatusCAN();<br> public native String ReceiveStatusCAN(String recievedpaquet, int nombre_de_paquets);<br> public native char SendStatusCAN( char[] sentpaquet );
<br> public native char InitStatusCAN();<br> <br> <br> public static void main (String argv [])<br> {<br> CanNative toto = new CanNative();<br> toto.printInfoRevision();<br> char[] sentpaquet=new char[14];
<br> sentpaquet[0]='A';<br> sentpaquet[1]='Z';<br> sentpaquet[2]='E';<br> sentpaquet[3]='R';<br> sentpaquet[4]='T';<br> sentpaquet[5]='Y';
<br> sentpaquet[6]='U';<br> sentpaquet[7]='I';<br> sentpaquet[8]='O';<br> sentpaquet[9]='P';<br> sentpaquet[10]='Q';<br> sentpaquet[11]='S';
<br> sentpaquet[12]='D';<br> sentpaquet[13]='F';<br> String zozo = new String();<br> toto.InitCan();<br> toto.ReceiveCAN(zozo, 1);<br> toto.SendCan(sentpaquet);
<br> toto.CloseCan();<br> }<br><br>}<br></div><br>I've use jni.h and jni_m.h that come from kaffe (the one that i've built) and built the class with the -1.3 parameter.<br><br>Does anyone have ever used JNI with Kaffe on an ARM target? is there any particular argument to use during the building step?
<br><br>With kind of regards<br><br>Frederic<br>