Java 8?

214 görüntüleme
İlk okunmamış mesaja atla

Jim Lloyd

okunmadı,
15 Eki 2014 14:13:5415.10.2014
alıcı node...@googlegroups.com
Can node-java be used with .jars compiled with Java 8 that require Java 8? 

I'm looking into updating the npm package gremlin to work with the Tinkerpop3, which requires Java 8. In my quick experiment, I'm getting this error:

Error: Could not create class com.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader
java.lang.UnsupportedClassVersionError: com/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader : Unsupported major.minor version 52.0

I do have Java 8 installed.

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Thanks,
Jim

Jim Lloyd

okunmadı,
17 Eki 2014 11:35:2417.10.2014
alıcı node...@googlegroups.com
I posted this message a couple days ago and have not seen a response. If changes are necessary for node-java to work with Java 8 then I can spend some of my day-job time working to make it happen, i.e. prepare a pull request with all necessary changes. However, I am starting from scratch with figuring out how node-java works, so any leads/guidance would be helpful. FYI I have extensive C/C++ experience, and moderate java and node.js experience. I am now a contributor to gremlin-node and titan-node and my goal is to update gremlin-node for TinkerPop3, and likewise update titan-node when the Aurelius Titan team releases Titan 0.9 which will support TinkerPop3.

Thanks,
Jim

--
You received this message because you are subscribed to the Google Groups "node-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-java+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Ferner

okunmadı,
17 Eki 2014 13:04:5817.10.2014
alıcı node...@googlegroups.com
Does that same code work with JDK 7?

I haven't tested node-java with JDK8 but I don't see why it shouldn't work. node-java essentially creates a JVM and uses JNI to create and manage the java objects. 

One of the possible problems could be around how the JVM is initialized here: https://github.com/joeferner/node-java/blob/master/src/java.cpp#L164.  I would like to maintain backward compatibility with JDK 1.6 but if we could come up with a way to make this option configurable it would be nice.

Jim Lloyd

okunmadı,
17 Eki 2014 13:56:5717.10.2014
alıcı Joe Ferner, node...@googlegroups.com
Hi Joe,

TinkerPop3 requires JDK8. Gremlin-node is currently using TinkerPop2, which works with JDK7. I encountered the errors after changing gremlin-node to use the TinkerPop3 .jars.

I have done some hacking this morning. I found four places where the code uses JNI_VERSION_1_6, and changed those to JNI_VERSION_1_8, and made some related changes. It looks like these will be sufficient to make JDK8 work, but of course they lose JDK6 backward compatibility. I haven't yet tried to figure out how to make this configurable.

I just sent you a PR with the changes made so far: https://github.com/joeferner/node-java/pull/164

Jim



Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti