Hi,

The following quick whacky hacks make Eclipse 3.0M4 work on my Debian
GNU/Linux machine with gtk+ 2.2 installed.

You will need eclipse-SDK-3.0M4-linux-gtk.zip from:
http://download2.eclipse.org/downloads/drops/S-3.0M4-200310101454/

First replace java/net/URLen/decode.java with the versions from GNU
Classpath.

The apply the attached quick hack that implements provides two (fake)
implementations for Get/ReleasePrimitiveArrayCritical JNI functions.

Create a kaffe build which is configured with
--with-threads=unix-pthreads

After installation replace the kaffe/bin/java and kaffe/jre/bin/java
scripts with the attached versions.
(Eclipse needs some extra memory, doesn't like the default
java.vm.version=1.3 and uses some strange system property to get at the
bootstrap classes, finally our FileLock isn't implemented yet and throws
an Error but Eclipse looks at the last system property to know whether
or not to use it.)

The unzip the eclipse build you downloaded above.
And start it with something like:
PATH=/usr/local/kaffe/bin:$PATH 
LD_LIBRARY_PATH=/usr/local/kaffe/lib:/tmp/eclipse/plugins/org.eclipse.swt.gtk_3.0.0/os/linux/x86
 ./eclipse

Lots of things work and with the File->New Project and File->New Class
you get some wizard which should guide you through a simple "Hello
World" type program which you should be able to run with the menu
Run->Run As->Java Application to give you something like:
http://www.klomp.org/mark/classpath/Screenshot-Kaffe-Eclipse3.png

When you are finished playing look into workspace/.metadata/.log to see
what breaks. And then fix it :)

Cheers,

Mark
Index: include/jni.h
===================================================================
RCS file: /cvs/kaffe/kaffe/include/jni.h,v
retrieving revision 1.23
diff -u -r1.23 jni.h
--- include/jni.h	25 Oct 2003 12:52:39 -0000	1.23
+++ include/jni.h	30 Oct 2003 21:25:13 -0000
@@ -294,8 +294,8 @@
 	
 	void* reserved12; // GetStringRegion
 	void* reserved13; // GetStringUTFRegion
-	void* reserved14; // GetPrimitiveArrayCritical
-	void* reserved15; // ReleasePromitiveArrayCritical
+	void* (*GetPrimitiveArrayCritical)	(JNIEnv*, jarray, jboolean);
+	void  (*ReleasePrimitiveArrayCritical)	(JNIEnv*, jarray, void*, jint);
 	void* reserved16; // GetStringCritical
 	void* reserved17; // ReleaseStringCritical
 	void* reserved18; // NewWeakGlobalRef
Index: kaffe/kaffevm/jni.c
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/jni.c,v
retrieving revision 1.95
diff -u -r1.95 jni.c
--- kaffe/kaffevm/jni.c	25 Sep 2003 10:06:15 -0000	1.95
+++ kaffe/kaffevm/jni.c	30 Oct 2003 21:25:14 -0000
@@ -3024,6 +3024,12 @@
 	return (ret);
 }
 
+static void*
+Kaffe_GetPrimitiveArrayCritical(JNIEnv* env, jarray arr, jbool* iscopy)
+{
+  return (Kaffe_GetByteArrayElements(env, (jbyteArray)arr, iscopy));
+}
+
 static jchar*
 Kaffe_GetCharArrayElements(JNIEnv* env, jcharArray arr, jbool* iscopy)
 {
@@ -3159,6 +3165,12 @@
 }
 
 static void
+Kaffe_ReleasePrimitiveArrayCritical(JNIEnv* env, jbyteArray arr, jbyte* elems, jint mode)
+{
+  Kaffe_ReleaseByteArrayElements(env, (jbyteArray)arr, (jbyte*)elems, mode);
+}
+
+static void
 Kaffe_ReleaseCharArrayElements(JNIEnv* env, jcharArray arr, jchar* elems, jint mode)
 {
 	BEGIN_EXCEPTION_HANDLING_VOID();
@@ -4425,8 +4437,8 @@
 	Kaffe_GetJavaVM,
 	NULL,
 	NULL,
-	NULL,
-	NULL,
+	Kaffe_GetPrimitiveArrayCritical,
+	Kaffe_ReleasePrimitiveArrayCritical,
 	NULL,
 	NULL,
 	NULL,
#! /bin/sh
# Pretend Kaffe is Java
prefix=/usr/local/kaffe
exec_prefix=${prefix}
exec ${exec_prefix}/bin/kaffe -mx 256M -Djava.vm.version=1.3 -Dsun.boot.class.path=/usr/local/kaffe/jre/lib/rt.jar -Dorg.eclipse.core.runtime.ignoreLockFile=true ${1+"$@"}

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to