title: Eclipse Android SDK: Bad version number in .class file
body: <p>I'm trying to integrate the Android SDK into my Eclipse Indigo. I installed the ADT plugin Android SDK  r_17 mac OS and when I go to Preferences->Android, the following error shows up:</p>
  
  <p>Unable to create the selected preference page.
  Bad version number in .class file</p>
  
  <pre><code>java.lang.UnsupportedClassVersionError: Bad version number in .class file
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608)
  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
  at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
  at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
  at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
  at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
  at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
  at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
  at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
  at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
  at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
  at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:268)
  at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
  at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:264)
  at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:47)
  at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1339)
  at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:376)
  at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1230)
  at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674)
  at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
  at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
  at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
  at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
  at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
  at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
  at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)
  at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1726)
  at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1139)
  at org.eclipse.jface.preference.PreferenceDialog.selectSavedItem(PreferenceDialog.java:1054)
  at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.selectSavedItem(FilteredPreferenceDialog.java:729)
  at org.eclipse.jface.preference.PreferenceDialog$4.run(PreferenceDialog.java:375)
  at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
  at org.eclipse.jface.preference.PreferenceDialog.createContents(PreferenceDialog.java:371)
  at org.eclipse.jface.window.Window.create(Window.java:431)
  at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
  at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.createDialogOn(WorkbenchPreferenceDialog.java:102)
  at org.eclipse.ui.dialogs.PreferencesUtil.createPreferenceDialogOn(PreferencesUtil.java:192)
  at org.eclipse.ui.dialogs.PreferencesUtil.createPreferenceDialogOn(PreferencesUtil.java:116)
  at org.eclipse.ui.internal.handlers.ShowPreferencePageHandler.execute(ShowPreferencePageHandler.java:53)
  at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
  at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
  at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:178)
  at org.eclipse.ui.internal.cocoa.CocoaUIEnhancer.runCommand(CocoaUIEnhancer.java:393)
  at org.eclipse.ui.internal.cocoa.CocoaUIEnhancer.actionProc(CocoaUIEnhancer.java:535)
  at org.eclipse.ui.internal.cocoa.CocoaUIEnhancer.actionProc(CocoaUIEnhancer.java:520)
  at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
  at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4879)
  at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5226)
  at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
  at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:94)
  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
  at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
  at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
  at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
  at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
  at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
  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:592)
  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
  at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
  </code></pre>
  
  <p>Eclipse info:</p>
  
  <pre><code>eclipse.buildId=M20120208-0800
  java.version=1.5.0_30
  java.vendor=Apple Inc.
  BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=fr_FR
  Framework arguments:  -keyring /Users/stef/.eclipse_keyring -showlocation
  Command-line arguments:  -os macosx -ws cocoa -arch x86 -keyring /Users/stef/.eclipse_keyring -showlocation
  </code></pre>
  
  <p>Java version:</p>
  
  <pre><code>    java -version
      java version "1.5.0_30"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03-389-9M3425)
      Java HotSpot(TM) Client VM (build 1.5.0_30-161, mixed mode, sharing)
  </code></pre>
  
  <p>In the Eclipse, it is currently set to Java Compiler 1.5 and JRE J2SE 5.0. I've also tried with Java Compiler to 1.6 and JRE Java SE 6, still same result.</p>
  
  <p>What am I doing wrong?</p>