Syphon / Processing

Syphon Implementation for Processing
Other
137 stars 33 forks source link

java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer : Unsupported major.minor version 51.0 #15

Closed clankill3r closed 10 years ago

clankill3r commented 10 years ago

I can't run the new version (RC2) in IntelliJ (and probably also not eclipse). I think you went to a more recent JDK.

http://stackoverflow.com/questions/12770622/java-lang-unsupportedclassversionerror

If it's me that should update then please tell me.

Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer : Unsupported major.minor version 51.0
    at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
    at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
    at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
    at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
    at javax.media.opengl.Threading.invoke(Threading.java:191)
    at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
    at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
    at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
    at processing.core.PApplet.run(PApplet.java:2256)
    at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at codeanticode.syphon.SyphonServer.sendImage(Unknown Source)
    at server.ImageInOutput.draw(ImageInOutput.java:160)
    at processing.core.PApplet.handleDraw(PApplet.java:2386)
    at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
    at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
    at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer
    at codeanticode.syphon.SyphonServer.sendImage(Unknown Source)
    at server.ImageInOutput.draw(ImageInOutput.java:160)
    at processing.core.PApplet.handleDraw(PApplet.java:2386)
    at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
    at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
    at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
    at javax.media.opengl.Threading.invoke(Threading.java:193)
    at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
    at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:595)
    at javax.media.opengl.awt.GLCanvas.update(GLCanvas.java:795)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:267)
    at sun.awt.RepaintArea.paint(RepaintArea.java:233)
    at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
    at java.awt.Component.dispatchEventImpl(Component.java:4852)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:690)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
codeanticode commented 10 years ago

that's strange, java.target.version is set to 1.6 in the build properties of the lib, what version of the JDK are you using?

codeanticode commented 10 years ago

actually, this error might be "correct", in the sense that Processing itself moved to Java 7: http://stackoverflow.com/a/11432195

Even though the Syphon library is targeting 1.6, the core libs in Processing require JDK 7

clankill3r commented 10 years ago

But my processing works in IntelliJ along with 7 libraries that my project is using. Only the new syphon doesn't work.

If i run java -version in terminal i get:

java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

I'm really bad in those things (this shit makes me panic), and i'm really afraid to break something :)

codeanticode commented 10 years ago

Can you run Syphon from the PDE? What version of the core libs are you using in your IntelliJ project?

clankill3r commented 10 years ago

I can run it from the PDE and in IntelliJ i run the core from the most recent processing 2.2.1. (I double checked this).

clankill3r commented 10 years ago

IntelliJ uses Apple JDK 1.6 atm.

https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under

But that still doesn't explain why the latest processing can run in IntelliJ and Syphon won't. Looking at the error log in OP, what is JSyphon targeting?

codeanticode commented 10 years ago

JSyphon also targets against 1.6: https://github.com/Syphon/Java/blob/master/JSyphon/ant/build.xml

You can have Java 6 and 7 installed alongside in the same machine, can you change the JDK that IntelliJ uses?

clankill3r commented 10 years ago

"JDK 1.7 from Oracle is not officially supported yet and has known problems that stop us from using it by default."

Link from previous post.

Did someone else compiled Syphon for java then the previous time? Maybe he made changes to his ant build to target it 1.7?

It makes me wonder why the previous RC worked. Maybe i will use RC-1 and color the first pixel to tell the client what i'm sending. I'm not waiting for problems in IntelliJ and i prefer IntelliJ over Eclipse.

codeanticode commented 10 years ago

I believe I found the problem. Looking at the error again, the compatibility issue was specifically with jsyphon/JSyphonServer, which also targets 1.6 in the ant build file. However, the compiler level in Eclipse was not set, meaning that the .class files generated automatically by Eclipse were targeting 1.7. I very likely build the jsyphon jar without cleaning the binary folder, which means that the 1.7 class files were used by mistake. This should be corrected in RC3, please try it out and let me know if it works.

clankill3r commented 10 years ago

yes you did! Just in time, RC-1 stopped working for me. It works great, thanks a lot.

codeanticode commented 10 years ago

Great. Please let me know of any other issues with the RCs, as the plan is to have the 1.0 final out as soon as possible.

clankill3r commented 10 years ago

I will.

Edwardffigueroa commented 7 years ago

I can not use syphon in my intellij, could anyone help me? I have this problem: objc[1344]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. java.lang.ClassCastException: processing.awt.PGraphicsJava2D cannot be cast to processing.opengl.PGraphicsOpenGL at codeanticode.syphon.SyphonServer.<init>(Unknown Source) at Main.setup(Main.java:27) at processing.core.PApplet.handleDraw(PApplet.java:2393) at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1540) at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)

vade commented 7 years ago

Please don't spam every fucking issue with your problem.