Eclipse:创建新的JavaScript文件错误

时间:2013-10-23 08:13:23

标签: javascript eclipse git

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

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

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

enter image description here

谁能告诉我这里我做错了什么?这是一个错误吗?我不能只在不同的电脑上导入其他项目吗?或者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)

1 个答案:

答案 0 :(得分:0)

当我采取下一步措施时,问题不会发生:

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

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

Greets,David