我有一个用于大型 Java/Maven 项目的新 Emacs 设置(在 Windows 上)。
安装了 Eclipse 和 eclim(java 层更新到最新版本的 spacemacs,company-emacs-eclim 作为额外包安装),但是当 company-emacs-eclim 尝试自动完成时,它使用了错误的文件路径,两次插入项目文件夹,例如
X:/EclipseWorkspace/Project/Project/src/main/com/company/product/Klass.java
代替
X:/EclipseWorkspace/Project/src/main/com/company/product/Klass.java
错误信息是
Company: An error occurred in auto-begin
Company: backend company-emacs-eclim error "Could not read from "file:///X:/EclipseWorkspace/Project/Project/src/main/com/company/product/Klass.java" because it is a not a file." with args (candidates this)
在 eclimd 中,我得到一个带有相同消息的异常:
ERROR [org.eclim.command.Main] Command failed
org.apache.commons.vfs.FileSystemException: Could not read from "file:///X:/EclipseWorkspace/Project/Project/src/main/com/company/product/Klass.java" because it is a not a file.
at org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1109)
at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:317)
at org.eclim.util.file.FileUtils.byteOffsetToCharOffset(FileUtils.java:75)
at org.eclim.plugin.core.command.AbstractCommand.getOffset(AbstractCommand.java:99)
at org.eclim.plugin.core.command.AbstractCommand.getOffset(AbstractCommand.java:71)
at org.eclim.plugin.core.command.complete.AbstractCodeCompleteCommand.execute(AbstractCodeCompleteCommand.java:60)
at org.eclim.command.Main$1.run(Main.java:100)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4203)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3819)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
我试过关闭并重新打开工作区,在 Emacs 中重新打开项目,重新创建整个工作区,一切都给出了相同的结果。