[cygwin] enabling java support

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[cygwin] enabling java support

CdeMills
Hello,

there are a few modifications to bring under cygwin for java support. I have non-cygwin openjdk installed under /cygdrive/c/Program Files/Java/jdk1.7.0_45:

1) apply this patch:
--- a/libinterp/octave-value/ov-java.h  Thu Mar 06 14:40:35 2014 -0500
+++ b/libinterp/octave-value/ov-java.h  Mon Mar 10 20:13:45 2014 +0100
@@ -23,6 +23,12 @@
 #if !defined (octave_ov_java_h)
 #define octave_ov_java_h 1
 
+#if defined (__CYGWIN__)
+/* maps jni.h idea of 64-bit ints to gcc implementation */
+#include <stdint.h>
+typedef int64_t __int64 ; //Portable signed long integer 8 bytes
+#endif
+
 #include <jni.h>
 
 #include <oct-obj.h>

2) in "scripts/Makefile", use the following rule:
%.class : %.java
        $(MKDIR_P) java/$(org_octave_dir)
        ( cd $(srcdir)/java; "$(JAVAC)" -source 1.3 -target 1.3 -d `$(CYGPATH_W) $(abs_builddir)/java` $(org_octave_dir)/$(<F) )

The idea is to call  "java" with Windows path convention

3) This compiles ... but does not run:
x = javaObject ("java.lang.StringBuffer", "Initial string")
error: javaObject: /libjvm.so: failed to load: No such file or directory

It seems the lib to call is "libjvm.dll" instead of libjvm.so ? Any clue on how to force this ?

Regards

Pascal