Eclipse Juno-无法在首选项下查看类路径变量页面

92dk7w1h  于 2022-10-15  发布在  Eclipse
关注(0)|答案(2)|浏览(135)

我得到以下错误

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

当我导航到Eclipse首选项->Java->构建路径->类路径变量。我确实尝试了清理项目并重新启动eclipse。一旦我这样做了,它工作了,在再次构建项目后,我得到了同样的错误。我正在使用ADT 23.0处理Android项目。
这是我的错误日志

!MESSAGE Unable to create the selected preference page. !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport$JUnitPluginDescription.getSourceLocation(BuildPathSupport.java:112) at org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport$JUnitPluginDescription.getSourceBundleLocation(BuildPathSupport.java:64) at org.eclipse.jdt.internal.junit.buildpath.JUnitHomeInitializer.initializeSource(JUnitHomeInitializer.java:50) at org.eclipse.jdt.internal.junit.buildpath.JUnitHomeInitializer.initialize(JUnitHomeInitializer.java:31) at org.eclipse.jdt.core.JavaCore.getClasspathVariable(JavaCore.java:3251) at org.eclipse.jdt.internal.ui.wizards.buildpaths.VariableBlock.refresh(VariableBlock.java:409) at org.eclipse.jdt.internal.ui.wizards.buildpaths.VariableBlock.(VariableBlock.java:111) at org.eclipse.jdt.internal.ui.preferences.ClasspathVariablesPreferencePage.(ClasspathVariablesPreferencePage.java:50) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184) 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.createExtension(WorkbenchPlugin.java:265) at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:47) at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1340) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:377) at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1231) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:675) at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:709) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:705) 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.handlePostSelect(StructuredViewer.java:1226) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1251) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:262) at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:256) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:433) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) at 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) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

r7xajy2e

r7xajy2e1#

来自Bug 364628
如果在Eclipse的路径中存在加号(‘+’)(例如打开Classpath Variables首选项页面(Window->Preferences->Java->Build Path->Classpath Variables)会导致以下错误:

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

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

svdrlsy4

svdrlsy42#

只是确认一下我也有同样的问题。此外,无法运行任何Junit测试。
我下载了最新的Android SDK w Eclipse以及最新的JDK。我卸载并删除了以前存在的目录。
我正在使用一台64位的Windows 7笔记本电脑。
我在C:\Android中安装了adt-Bundle-windows-x86_64-20140702.zip。
为了找出可能的问题所在,我修改了所有相关设置,使我看不到任何对c:\USERS的引用...例如:

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

(请参阅《Eclipse》->《帮助》->《关于Eclipse》->《安装详情》->《配置》)

相关问题