[kaffe] JNI with Kaffe and ARM9

Frederic Kwiatkowski stagedrt at gmail.com
Wed Aug 1 00:30:17 PDT 2007


Hi all

I'm trying to use JNI with Kaffe but i've encountering some problems

It's seems that my .so library to be found but when i'm using the main
class, i've got the following error:

# java fr.ptv.valence.katolecho.cannative.CanNative
java.lang.NoSuchMethodError: main
   at java.lang.VMThrowable.fillInStackTrace (VMThrowable.java:native)
   at java.lang.VMThrowable.fillInStackTrace (VMThrowable.java:79)
   at java.lang.Throwable.fillInStackTrace (Throwable.java:498)
   at java.lang.Throwable.<init> (Throwable.java:159)
   at java.lang.Error.<init> (Error.java:81)
   at java.lang.LinkageError .<init> (LinkageError.java:72)
   at java.lang.IncompatibleClassChangeError.<init> (
IncompatibleClassChangeError.java:71)
   at java.lang.NoSuchMethodError.<init> (NoSuchMethodError.java:72)

To check if my .java and the librairy were bugless, i've just tried it with
succeed under win2K and JDK1.6

The Java file is the following:

package fr.ptv.valence.katolecho.cannative ;

public class CanNative {
    char[] sentpaquet = new char[14];
    char[] recievedpaquet = new char[14];
    static {

    if(System.getProperty ("os.name").equals("Linux"))
        System.loadLibrary("CanNative");
    else System.loadLibrary("libCanNative"); }

    public static void ThisIsATest(){
        System.out.println("This Is a test");
    }
    public native void printInfoRevision();

    public native char InitCan();
    public native char CloseCan();
    public native char SendCan(char[] sentpaquet);
    public native String ReceiveCAN(String recievedpaquet, int
nombre_de_paquets);
    public native int isBusOffCAN();
    public native void PrintLastErrorCAN();
    public native void CanBusFailed();
    public native void CanReset();
    public native int GetRxErr();
    public native int GetTxErr();
    public native int GetSpeedCAN();
    public native void CanTest();
    public native void CloseStatusCAN();
    public native String ReceiveStatusCAN(String recievedpaquet, int
nombre_de_paquets);
    public native char SendStatusCAN( char[] sentpaquet );
    public native char InitStatusCAN();


    public static void main (String argv [])
    {
        CanNative toto = new CanNative();
        toto.printInfoRevision();
        char[] sentpaquet=new char[14];
        sentpaquet[0]='A';
        sentpaquet[1]='Z';
        sentpaquet[2]='E';
        sentpaquet[3]='R';
        sentpaquet[4]='T';
        sentpaquet[5]='Y';
        sentpaquet[6]='U';
        sentpaquet[7]='I';
        sentpaquet[8]='O';
        sentpaquet[9]='P';
        sentpaquet[10]='Q';
        sentpaquet[11]='S';
        sentpaquet[12]='D';
        sentpaquet[13]='F';
        String zozo = new String();
        toto.InitCan();
        toto.ReceiveCAN(zozo, 1);
        toto.SendCan(sentpaquet);
        toto.CloseCan();
    }

}

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.

Does anyone have ever used JNI with Kaffe on an ARM target? is there any
particular argument to use during the building step?

With kind of regards


Frederic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kaffe.org/pipermail/kaffe/attachments/20070801/ac6b1677/attachment-0004.htm 


More information about the kaffe mailing list