We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everybody,
we are using a .jar library in our processing (3.3.7) sketch, which is based on java9. Is there a way to direkt the processing sketch to java9?
Thanks in advance, for any kind of suggestions!
This is the error:
java.lang.UnsupportedClassVersionError: ________________ has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at processing.core.PApplet.runSketch(PApplet.java:10691)
at processing.core.PApplet.main(PApplet.java:10467)
This version of Processing only supports libraries and JAR files compiled for Java 1.6 or earlier.
A library used by this sketch was compiled for Java 1.7 or later,
and needs to be recompiled to be compatible with Java 1.6.
Answers
thanks for your answer! Our question would be, if there is a processing version, fully compatible with java 9 at all - since this is not an option processing gives you before downloading.
@mmathias -- re:
No, there is not.
I have been working on the possibility of using jdk9 with JRubyArt and propane, both essentially ruby wrappers around processing. I have concluded there is not much I can do with JRubyArt, which relies on a user installed version of processing, however I have found a workaround by compiling my own version of processing-core (albeit with jdk8) for propane. Most sketches apart from those using javaFX actually run OK with jdk9, however with opengl there are a lot of warnings https://github.com/ruby-processing/propane/issues/22.
PS: I'm not saying that you could use propane to use your library as currently configured, but if it was compiled with jdk9 instead of jdk8 it probably would, these are experiments I have yet to do (because at present backward compatibility to jdk8 is important).
Update:- won't compile with jdk9 because
com.sun.glass.ui.Screen
is referred to in PSurfaceFX.java, and since jdk9 proprietary code is not available.@GoToLoop - Processing is never going to support Java 9. In fact, Java 9 has already been superseded by Java 10, neither of which are LTS. Processing should eventually support Java 11 (LTS) coming out in September.
@mmathias - what's the library? Can it be recompiled for Java 8? A library requiring Java 9 is somewhat unusual at the moment.
var
. Another feature for PDE's pre-processor to be compatible w/.@GoToLoop - yes, just making the point that the Processing devs have already mentioned the intention not to officially support running on Java other than LTS. And note that running on and supporting the features of are not the same thing - see monkstone's comment.
JavaFX being removed from the core JDK may not actually be a bad thing for its development, and may not prove to be too much of a headache.
And it's no secret I think the pre-processor is a bad idea! It holds back supporting newer language features for very little gain.
Still, all this is getting even more OT! ;-)
IMO, PDE's pre-processor is what makes Processing easier for beginners. B-)
It makes Java easier than Python! ~O)
However, it shoulda been the decade ago for PDE's pre-processor to be fully Java compliant. [-(
The API is what makes Processing great for beginners. The minimal language changes in the pre-processor add very little, cause bugs and lots of extra work for the devs, and keeps Processing syntax behind Java's. The wrapping everything in a class would be better handled by the editor.
Anyway, that's my opinion ... and going well OT.
Well, I'm happy PDE's pre-processor "eliminates" this whole "complicated" block: \m/
That thing is what makes Java worse for beginners than Python! 3:-O
Remove that outta sight and Java can finally be used for teaching beginners as well! :>
Yes, and as I said you can do that entirely within the editor without changing Java's syntax at all (the approach used in Praxis LIVE's editor, hence how it can support all of Java 8 without needing the extra boilerplate you mention). Maybe look at some other Java educational tools too.
Like Greenfoot? https://www.Greenfoot.org/home O:-)