Eclipse juno - 无法在首选项下查看classpath变量页面

时间:2014-08-07 10:25:58

标签: android eclipse

我收到以下错误

 Unable to create the selected preference page.
    java.lang.NullPointerException

当我导航到Eclipse首选项 - > Java->构建路径 - >类路径变量时。我确实尝试清理项目并重新启动eclipse。一旦我再次构建项目,我就这样做了。同样的错误。我正在使用ADT 23.0开发android项目。

这是我的错误日志

  

!MESSAGE无法创建所选的首选项页面。 !堆栈0   java.lang.NullPointerException at   org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport $ JUnitPluginDescription.getSourceLocation(BuildPathSupport.java:112)     在   org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport $ JUnitPluginDescription.getSourceBundleLocation(BuildPathSupport.java:64)     在   org.eclipse.jdt.internal.junit.buildpath.JUnitHomeInitializer.initializeSource(JUnitHomeInitializer.java:50)     在   org.eclipse.jdt.internal.junit.buildpath.JUnitHomeInitializer.initialize(JUnitHomeInitializer.java:31)     在   org.eclipse.jdt.core.JavaCore.getClasspathVariable(JavaCore.java:3251)     在   org.eclipse.jdt.internal.ui.wizards.buildpaths.VariableBlock.refresh(VariableBlock.java:409)     在   org.eclipse.jdt.internal.ui.wizards.buildpaths.VariableBlock。(VariableBlock.java:111)     在   org.eclipse.jdt.internal.ui.preferences.ClasspathVariablesPreferencePage。(ClasspathVariablesPreferencePage.java:50)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   方法)at   sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown   来自java.lang.reflect.Constructor.newInstance(未知来源)     在java.lang.Class.newInstance0(未知来源)at   java.lang.Class.newInstance(未知来源)at   org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)     在   org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)     在   org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)     在   org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)     在   org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:265)     在   org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:47)     在   org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1340)     在   org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:377)     在   org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1231)     在   org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:675)     在   org.eclipse.jface.preference.PreferenceDialog $ 10.run(PreferenceDialog.java:709)     在   org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)     在   org.eclipse.jface.preference.PreferenceDialog $ 9.selectionChanged(PreferenceDialog.java:705)     在   org.eclipse.jface.viewers.StructuredViewer $ 3.run(StructuredViewer.java:888)     在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 at   org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)     在   org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1226)     在   org.eclipse.jface.viewers.StructuredViewer $ 5.widgetSelected(StructuredViewer.java:1251)     在   org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:262)     在   org.eclipse.jface.util.OpenStrategy.access $ 5(OpenStrategy.java:256)     在org.eclipse.jface.util.OpenStrategy $ 3.run(OpenStrategy.java:433)     在org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)at   org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)     在   org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)     在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)     在org.eclipse.jface.window.Window.runEventLoop(Window.java:825)at   org.eclipse.jface.window.Window.open(Window.java:801)at   org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)     在   org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)     在org.eclipse.jface.action.Action.runWithEvent(Action.java:498)at   org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)     在   org.eclipse.jface.action.ActionContributionItem.access $ 2(ActionContributionItem.java:501)     在   org.eclipse.jface.action.ActionContributionItem $ 5.handleEvent(ActionContributionItem.java:411)     在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)     在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)at   org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)     在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)     在   org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $ 9.run(PartRenderingEngine.java:1053)     在   org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)     在   org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)     在   org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)     在org.eclipse.ui.internal.Workbench $ 5.run(Workbench.java:588)at   org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)     在   org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)     在   org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)     在   org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)     在   org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)     在   org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)     在   org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)     在   org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)     在   org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)at at   org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)at at   org.eclipse.equinox.launcher.Main.run(Main.java:1438)at   org.eclipse.equinox.launcher.Main.main(Main.java:1414)

2 个答案:

答案 0 :(得分:0)

来自Bug 364628

  

如果Eclipse的路径中存在加号(' +')(例如" C:\ Apps \ Eclipse \ 3.7 + SDK \ eclipse.exe") ,打开Classpath Variables首选项页面(Window - > Preferences - > Java - > Build Path - > Classpath Variables)会导致以下错误:

 Unable to create the selected preference page.
  java.lang.NullPointerException

从路径中删除加号可以解决问题。

答案 1 :(得分:-1)

刚刚确认我有同样的问题。另外,无法运行任何Junit测试。

我下载了最新的Android SDK和Eclipse以及最新的JDK。 我卸载了,删除了以前的现有目录。

我正在使用64位Windows 7笔记本电脑。

我在C:\ Android中安装了adt-bundle-windows-x86_64-20140702.zip。

为了找到可能出错的地方,我修改了所有相关设置 这样我就看不到对c:\ users的任何引用了...... e.g。

   Pointing ANDROID_SDK_HOME , ECLIPSE_HOME, HOME =C:\Android\Home
   -Duser.home=C:\Android\Home
   -Djava.io.tmpdir=C:\Android\Home\Temp

(参见Eclipse->帮助 - >关于Eclipse->安装细节 - >配置)