1

首先,我在 GitHub 中创建了一个项目,使用 Egit 将其导入到 Eclipse (kepler) 中,并使其成为一个 JavaScript 项目(使用标准 javascript 插件)。我在这个项目中工作没问题。我将整个项目(包括 .project 文件等)推送到了 GitHub。

现在,当我在另一台计算机上导入这个项目时,事情变得很奇怪。我使用 Egit 从 GitHub 存储库中导入了它。然后我将导入用作现有项目,因为我用它上传了所有项目文件。现在这很好用,直到我想创建一个新的 JavaScript 文件。

当我这样做时,新的创建一个新的 JavaScript 文件。窗口出现,但是当我输入名称时,完成按钮保持禁用状态。此外,当我单击其中一个父文件夹时,我得到一个空指针异常:

在此处输入图像描述

谁能告诉我我在这里做错了什么?这是一个错误吗?我不能只在不同的电脑上导入其他项目吗?还是 git 出了什么问题?

这是错误日志:

从插件调用代码时出现问题:“org.eclipse.jface”。

java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.ui.wizards.NewJSFileWizardPage.validatePage(NewJSFileWizardPage.java:122)
    at org.eclipse.ui.dialogs.WizardNewFileCreationPage.handleEvent(WizardNewFileCreationPage.java:676)
    at org.eclipse.ui.internal.ide.misc.ResourceAndContainerGroup.handleEvent(ResourceAndContainerGroup.java:367)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
    at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2974)
    at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4752)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4614)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2443)
    at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:260)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
    at org.eclipse.swt.widgets.Text.windowProc(Text.java:2597)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
    at org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method)
    at org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3473)
    at org.eclipse.swt.widgets.Text.setText(Text.java:2252)
    at org.eclipse.ui.internal.ide.misc.ContainerSelectionGroup.containerSelectionChanged(ContainerSelectionGroup.java:190)
    at org.eclipse.ui.internal.ide.misc.ContainerSelectionGroup$1.selectionChanged(ContainerSelectionGroup.java:276)
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
    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.Viewer.fireSelectionChanged(Viewer.java:162)
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188)
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1241)
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:239)
    at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:233)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)
    at org.eclipse.jface.window.Window.open(Window.java:802)
    at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
    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:1057)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    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:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    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:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
4

1 回答 1

0

当我采取以下步骤时,问题不会发生:

  • 使用 Git 导入项目(项目文件除外)
  • 将项目添加为通用项目
  • 将其转换为 JavaScript 项目。

这已经解决了我的问题,但我仍然想知道我在使用其他方法时做错了什么。

问候,大卫

于 2013-10-23T16:44:54.960 回答