Loading...
Logo
Processing Forum
I'm not sure if this is a Programming Question exactly - it's possible it should be a bug report (edit: it is also that now), or a Contributed Library question - but I figured I should probably post here first in case anyone has any leads. 

I wanted to record a video clip of my sketch but the core video library didn't work for some reason, so I tried gsvideo, but it said it didn't have all the methods the example code used, so I downloaded a new version of the library, but that gave me an UnsupportedClassVersionError. 'A library is using code compiled with an unsupported version of Java'.

Now I'm getting that error with ALL my sketches, even though I removed the code, and have now removed the library entirely and restarted Processing!

I am very confused.

Anyone got any suggestions? Similar experiences?

I should say  I'm on a Mac OS X , Version 10.5.8. Processing 2.0a8. Worked fine this morning!

Console output:

Copy code
  1. This version of Processing only supports libraries and JAR files compiled for Java 1.6 or earlier.
  2. A library used by this sketch was compiled for Java 1.7 or later, 
  3. and needs to be recompiled to be compatible with Java 1.6.
  4. Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
  5. at java.lang.ClassLoader.defineClass1(Native Method)
  6. at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
  7. at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
  8. at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
  9. at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
  10. at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  11. at java.security.AccessController.doPrivileged(Native Method)
  12. at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  13. at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
  14. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
  15. at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
  16. at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)

Replies(1)

Somewhat relieved to find that this problem mostly goes away when I switch back to 2.0a4. Only one of my non-library-using sketches fails to run with the earlier version, with this subtly different error output:

Copy code
  1. Display 0 does not exist, using the default display instead.
  2. This version of Processing only supports libraries and JAR files compiled for Java 1.5.
  3. A library used by this sketch was compiled for Java 1.6 or later, 
  4. and needs to be recompiled to be compatible with Java 1.5.
  5. Exception in thread "Animation Thread" java.lang.UnsupportedClassVersionError: Bad version number in .class file
  6. at java.lang.ClassLoader.defineClass1(Native Method)
  7. at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
  8. at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
  9. at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
  10. at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
  11. at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  12. at java.security.AccessController.doPrivileged(Native Method)
  13. at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  14. at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
  15. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
  16. at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
  17. at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
  18. at java.lang.Class.getDeclaredConstructors0(Native Method)
  19. at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
  20. at java.lang.Class.getConstructor0(Class.java:2671)
  21. at java.lang.Class.getConstructor(Class.java:1629)
  22. at processing.core.PApplet.makeGraphics(PApplet.java:1557)
  23. at processing.core.PApplet.size(PApplet.java:1370)
  24. at processing.core.PApplet.size(PApplet.java:1341)
  25. at Dragoria.setup(Dragoria.java:33)
  26. at processing.core.PApplet.handleDraw(PApplet.java:1881)
  27. at processing.core.PApplet.run(PApplet.java:1803)
  28. at java.lang.Thread.run(Thread.java:655)