Community
Participate
Working Groups
Build: I20030718 (M2) Trying to evaluate any snippet in a scrapbook in my workspace results in an UnsupportedClassVersionError. This is using VM J9SC build 20030624 (without -Xj9 vm arg). I don't get any errors with a standard 1.3 VM. Any ideas? I can open a defect against the VM vendor if you think that's where the problem is. A trivial snippet (such as "5+5") causes the failure. Here is the stack: java.lang.UnsupportedClassVersionError: CodeSnippet_10 (Unsupported major.minor version 48.0) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:133) at java.net.URLClassLoader.defineClass(URLClassLoader.java:319) at java.net.URLClassLoader.access$400(URLClassLoader.java:92) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:681) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:243) at java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.lang.ClassLoader.loadClass(ClassLoader.java:448) at java.lang.Class.forName1(Native Method) at java.lang.Class.forName(Class.java:145) at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain1.eval(ScrapbookMain1.java:21) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop(ScrapbookMain.java:55) at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main(ScrapbookMain.java:33) at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop(ScrapbookMain.java:55) at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main(ScrapbookMain.java:33)
I do not see this error (using the VM J9SC build 20030714a). However, could you look at your installed JRE definition to see if the problem may be related to bug 40673. Is it missing libraries?
This is likely a different problem. What compilation preferences do you have for the project the snippet is compiled in? i.e. anything special?
Created attachment 5548 [details] Project compiler preferences
I've figured it out. That project had the compiler compliance level set to 1.4, although I'm using a 1.3 VM. So I was doing something wrong, but I think there should have been a better warning somewhere (from the compiler?).
There are two problems - when compiling against 1.3 with 1.4 compliance, there should be a compiler error (I will move this bug there). The runtime issue is ours - i.e. running 1.4 files against a 1.3 VM (already filed bug 38319).
Did you enable the existing warning ? Preferences > Java > Compiler > Build path > Incompatible Required Binaries
Closing, please reopen if suggested warning does not work.
I'm wondering if "Incompatible required binaries" should be a warning by default instead of ignore. In my case I just got an obscure failure when running the program, and it took some investigation and help from Darin to figure out what was wrong.
More discussions about this warning: bug 390446.