Error Bad version number in .class file when trying to creat

Posted by Kabou on 09-Apr-2010 10:03

Hi,

Since today I do not any more manage to create a new java custom service (in existing project or new one).

In the eclipse workbench, I ask for the creation of a new cutsom service. The GUI pop up the creation windows.

After having set all fields, I confirm the creation of the service.

The window does not disappear, my service is not created and I have the following error :

Message :: Bad version number in .class file

java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at org.eclipse.emf.codegen.jet.JETEmitter$EclipseHelper.initialize(JETEmitter.java:573)

at org.eclipse.emf.codegen.jet.JETEmitter.initialize(JETEmitter.java:326)

at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:378)

at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:367)

at com.sonicsw.tools.plugin.jsde.codegen.ServiceWrapperGenerator.generate(ServiceWrapperGenerator.java:58)

at com.sonicsw.tools.plugin.jsde.wizard.NewJavaServiceWizard.createServiceFactoryClass(NewJavaServiceWizard.java:396)

at com.sonicsw.tools.plugin.jsde.wizard.NewJavaServiceWizard.performFinish(NewJavaServiceWizard.java:162)

at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)

at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)

at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)

at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)

at org.eclipse.jface.window.Window.open(Window.java:796)

at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:110)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)

at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)

at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)

at org.eclipse.core.launcher.Main.basicRun(Main.java:280)

at org.eclipse.core.launcher.Main.run(Main.java:977)

at org.eclipse.core.launcher.Main.main(Main.java:952)

Would anybody have already met this problem?

All Replies

Posted by Bill Wood on 09-Apr-2010 15:23

The message below is usually associated with the JVM used to run a class being different from the Java version used by the compiler.

Message :: Bad version number in .class file

Because this is happening while you are using Sonic Workbench, you should make sure that the JVM used on the eclipse startup line on eclipse.ini file is one that is supported by workbench.  If you are picking up a random Java JVM in your JAVA_HOME, then this may have changed.

You probably are in Sonic 7.6.x and you should have a Java 1.5.0_11 or some such

Posted by Kabou on 12-Apr-2010 03:28

Thank you for your help, It works.

I had tried to change the version of the JVM in the project but not in Eclipse.

In the same kind of problem. Is it recommended (or possiblke) to use the last version of eclipse with the workbench?

Posted by tsteinbo on 12-Apr-2010 03:31

For Sonic 7.6.0 and 7.6.1 we only support Eclipse 3.2.3.

For Sonic 7.6.2 we support both 3.2.3 and 3.4.2

For Sonic 8.0 we support 3.5.0

All other Eclipse version are not supported. In particular trying to use Eclipse 3.5 with any 7.6.x version will not work.

Thomas

This thread is closed