World: r4wp
[#Red] Red language group
older newer | first last |
Pekr 9-May-2013 [7648] | JNIdemo.dll |
DocKimbel 9-May-2013 [7649x2] | Right. |
Now you need to compile the Java side. | |
Pekr 9-May-2013 [7651] | you mean JNIdemo.java, right? And for that, I need JDK installed .... |
Andreas 9-May-2013 [7652] | Someone can also send you the compiled .class file, but you'll at least need the JRE installed :) |
DocKimbel 9-May-2013 [7653x2] | Yep. |
Right, if you need to install Java, go for the JDK instead of the JRE. | |
Pekr 9-May-2013 [7655x2] | My idea is, that I don't need JAVA at all, and that Red compiler spits out final app for me :-) |
well, I mean - that I don't need JDK, just typical JAVA client installation ... | |
DocKimbel 9-May-2013 [7657] | Andreas, does it work on Linux for you? It seems there's a library path access issue there. |
Andreas 9-May-2013 [7658x2] | That's the JRE. |
(@Pekr ^^) | |
Pekr 9-May-2013 [7660] | JRE is typically installed on Windows machines, but not sure nowadays. But I somehow has it insatlled on my notebook ... |
Andreas 9-May-2013 [7661] | @Pekr: http://bolka.at/2013/red/JNIdemo.class(compiled with Java 7; hope that doesn't cause problems). |
DocKimbel 9-May-2013 [7662x2] | Pekr: if you want to put yourself in the end-user shoes only, then just forget about this Java stuff until we get full Android support. If you want to test the steps in the meantime, just install the JDK. |
Andreas, you need to publish the events.class file too, or they won't be able to close the window. ;-) | |
Pekr 9-May-2013 [7664x2] | downloading JDK, but good to know, that end users will not need to fight all that stuff ... |
well, what is the .class file good for anyway, even if I have JRE? | |
Andreas 9-May-2013 [7666] | The .class file is Java's "exe". |
DocKimbel 9-May-2013 [7667] | Java 7: I think I've relied on Java 6 docs, but it should work as these are old APIs. |
Andreas 9-May-2013 [7668] | http://bolka.at/2013/red/events.class |
DocKimbel 9-May-2013 [7669] | Hmm, on second thought, Pekr, if you don't know what .class are, maybe don't bother with JDK then...;-) |
Andreas 9-May-2013 [7670] | With the JRE, you can run code in .class files. |
DocKimbel 9-May-2013 [7671] | We'll provide precompiled classes for you to test. |
Andreas 9-May-2013 [7672] | Hmm, the above classes don't run for me with a Java 6 JRE. So ignore them, if you don't have Java 7 already. |
DocKimbel 9-May-2013 [7673] | > java -version java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b07) Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing) |
Pekr 9-May-2013 [7674] | Well, looking into binary .class, I expected it being some kind of executable or package, just pressing Enter does nothing :-) So it is not mapped to JRE on my machine .... I selected it manually, and it says: Could not find or load main class, or something like that ... |
Andreas 9-May-2013 [7675] | open a command prompt, change to the directory the .class is stored in, and run `java JNIdemo` |
Pekr 9-May-2013 [7676] | error and crash "problematic frame ...." |
DocKimbel 9-May-2013 [7677] | Pekr: > java -version |
Pekr 9-May-2013 [7678x2] | 1.7.0_13 |
Exception Access Violation (0xc0000005) | |
Andreas 9-May-2013 [7680x2] | Get a "problematic frame" crash as well (Linux, 6.0_26-b03). |
Doc: for Linux to work, you need to rename the .so to libJNIdemo.so, and start the demo with `java -Djava.library.path=. JNIdemo`. | |
DocKimbel 9-May-2013 [7682] | Andreas and Pekr: are you using 64-bit OSes? |
Pekr 9-May-2013 [7683] | yes |
DocKimbel 9-May-2013 [7684] | That might be related... |
Pekr 9-May-2013 [7685] | I might try downloading 32 bit version then ... |
DocKimbel 9-May-2013 [7686] | Will try on a 64-bit too... |
Andreas 9-May-2013 [7687] | I tried it on a 32b OS. |
DocKimbel 9-May-2013 [7688] | Andreas, are you using OpenJDK? |
Andreas 9-May-2013 [7689x3] | Nope. Sun's JRE. |
$ java -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode) | |
(/JDK) | |
DocKimbel 9-May-2013 [7692] | Ah, will try to upgrade mine to 0_26 at least. |
Andreas 9-May-2013 [7693x2] | Crash seems to be in libc, so it's probably the missing dllinit code for ELF. |
Stack: [0xb69b4000,0xb6a05000], sp=0xb6a03ea8, free space=319k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libc.so.6+0x764f3] short+0x33 V [libjvm.so+0x3f1541] unsigned+0xe1 C [libJNIdemo.so+0xc9c] long double+0xc9c C [libJNIdemo.so+0xd24] long double+0xd24 C [libJNIdemo.so+0xefd] Java_JNIdemo_doMain+0xbd j JNIdemo.doMain()V+0 | |
DocKimbel 9-May-2013 [7695] | It's crashing for Pekr too, and he's probably on Windows. |
Pekr 9-May-2013 [7696x2] | yes, Windows8 |
Do you want me to send you an error log it generated in the working directory? | |
older newer | first last |