[kaffe] jni & two dimensional arrays

Daniel Dittmann ddittmann at gmx.de
Mon Sep 22 23:24:02 PDT 2003

Hi all,

i want to call an jni-function with an parameter of two-dimensional 
array of int.

The complete example from:


public class ArrayManipulation {

public native void manipulateArray(
		int[][] multiplier, Boolean lock);


The generation of the c-headerfile failed.

 >/usr/local/kaffe/bin/javac ArrayManipulation.java
 >export CLASSPATH=./:/usr/local/kaffe/jre/lib/rt.jar
 >/usr/local/kaffe/bin/javah ArrayManipulation
bogus array type `['

The attached patch fixed this error.

Thank you

diff -Naur kaffe/kaffe/kaffeh/support.c kaffe.patched/kaffe/kaffeh/support.c
--- kaffe/kaffe/kaffeh/support.c	2003-09-19 10:51:56.000000000 +0200
+++ kaffe.orig/kaffe/kaffeh/support.c	2003-08-01 00:46:45.000000000 +0200
@@ -311,6 +311,7 @@
  		case 'D':
  			return "jdoubleArray";
  		case 'L':
+		case '[':
  			return "jobjectArray";
  			dprintf("bogus array type `%c'", sig[1]);

More information about the kaffe mailing list