World: r4wp
[#Red] Red language group
older newer | first last |
DocKimbel 9-May-2013 [7708x6] | Kaj: good points. For the VM parameter, it's unused anyway. |
It's crashing anyway. | |
Found the cause of the error, will push a fix in a few minutes. | |
It's now running fine on my Linux 32-bit image. | |
Tested ok on Mac OSX 10.6.2 (adding the -d32 option for running the JVM in 32-bit mode). | |
The window closing is generating a Java exception on OSX, I will improve the code to make a more JVM-friendly exit. | |
Pekr 9-May-2013 [7714x2] | hmm, nice observation, this java crap is case sensitive :-) |
whoever came with case sensitivity in unix like system, should have broken hands long time ago :-) | |
DocKimbel 9-May-2013 [7716] | Does it work now for you? |
Pekr 9-May-2013 [7717] | basically I got it working, it generated some events.class, but when I close the dialog, it throws some exceptions back to console. But yes, it is working .... |
DocKimbel 9-May-2013 [7718x2] | Can you show me the full output of `java -version`? |
(checking if you're using a 64-bit VM) | |
Pekr 9-May-2013 [7720] | java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode) |
DocKimbel 9-May-2013 [7721] | Ok, try adding -d32 option when launching the app. |
Pekr 9-May-2013 [7722] | hmm, now tried to delete .class files and regenerate, I obtained following: Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\!rebol\!Red\Red\re d-system\bridges\java\JNIdemo.dll: Can't load IA 32-bit .dll on a AMD 64-bit pla tform at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary1(Unknown Source) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at JNIdemo.<clinit>(JNIdemo.java:9) |
DocKimbel 9-May-2013 [7723] | Have you used -d32 for launching the JVM? |
Pekr 9-May-2013 [7724x2] | I have some mess on my system, installing JDK did not add it to path, so I have to issue long Windows shitty path in console each time .... |
Yes: Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\!rebol\!Red\Red\re d-system\bridges\java\JNIdemo.dll: Can't load IA 32-bit .dll on a AMD 64-bit pla tform | |
DocKimbel 9-May-2013 [7726x2] | I'm upgrading my JDK to 1.7 to see if I can reproduce those issues. |
Pekr, I'm afraid you'll need to install a 32-bit JVM to make it work with Red. | |
Pekr 9-May-2013 [7728x3] | well, dunno how, but it worked initially (dialog appeared), then I deleted .class files, and not being able to get it working again ... |
sho should I download whole 32 bit JDK? | |
downloading now ... | |
DocKimbel 9-May-2013 [7731x5] | The first class files where generated on Andreas 32-bit machine. |
were | |
Use the minimal JDK version. | |
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html | |
You might need to uninstall the 64-bit version first. | |
Pekr 9-May-2013 [7736] | they can't coexist? Btw - so 64 bit version is no go ATM? |
DocKimbel 9-May-2013 [7737x3] | I'm not sure they can coexit as Java is setting some environment variables that are unique. |
Upgraded my JDK to 1.7.0_21, recompiled JNIdemo on Win7, everything is working fine. | |
Looks like -d32 option is working on OSX only, so a 32-bit JVM is required on other platforms. | |
Andreas 9-May-2013 [7740] | (My .class files where generated on a 64-bit machine, but that does not matter.) |
DocKimbel 9-May-2013 [7741x2] | Anyway, Android is using a 32-bit JVM. |
So we shouldn't have a problem there. | |
GrahamC 9-May-2013 [7743] | What does the bridge do? |
DocKimbel 9-May-2013 [7744x2] | There's only the low-level part of the bridge currently. It binds to the JVM through JNI and allows to create Java objects, call their methods, define callbacks to Red/System code, etc... |
It's a remote control for the JVM from Red/System, you can do most of what a Java program can do. | |
GrahamC 9-May-2013 [7746x2] | similar aim to the SL4A then |
except without restriction | |
DocKimbel 9-May-2013 [7748x4] | I'm not sure how SL4A binds to the JVM, but you can't get closer than JNI. |
Wow, SL4A seems to use JSON messages over TCP...talk about an overhead. :-) | |
JNI native code is running in the same thread as the JVM. | |
as the JVM => "as the Java program" | |
GrahamC 9-May-2013 [7752] | but SL4A allows remote control of an android device :) |
DocKimbel 10-May-2013 [7753] | FYI, I'm re-arranging the Red compiler code output in order to allow the Red runtime library initialization on DLL loading. Once that done, we'll be able to produce Red shared libs (the exporting interface remains at Red/System level though). |
Gregg 10-May-2013 [7754] | Excellent Doc. That sounds great. |
james_nak 10-May-2013 [7755] | Very cool Doc. |
DocKimbel 11-May-2013 [7756x2] | I've compiled and run my first Red shared library. Use #call directive to call back Red functions from Red/System. |
Declare your Red/System exported function in a #system-global block. | |
older newer | first last |