8

我在 Windows 10 上运行 Eclipse 2018-09 (4.9.0)。我使用的是 Open JDK 11 GA。我有一个使用 Java 8 兼容源代码的项目,该项目使用 JDK 编译良好,来自 Eclipse 和 Maven。

我想使用新的 Java 11 功能,所以首先我将编译器源/目标从 Java 8 更改为 Java 11。它仍然在命令行上使用 Maven 构建 find,但无法在 Eclipse 中编译(参见Eclipse 2018-09 won 't 编译 Java 11 源代码;认为它低于 1.7)。

所以我从 Eclipse Marketplace 添加了“Java 11 Support for Eclipse 2018-09”插件。我重新启动了 Eclipse 并用来Alt+F5刷新我的 Maven 项目。然后 Eclipse 尝试重建该项目。

现在 Eclipse 进入一个无限循环,在 8X% 完成到 9X% 完成之间跳跃,出现重复的、无休止的错误,例如:

!SESSION 2018-09-27 08:08:51.188 -----------------------------------------------
eclipse.buildId=4.9.0.I20180906-0745
java.version=11
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

This is a continuation of log file …\.metadata\.bak_0.log
Created Time: 2018-09-27 08:11:22.981

!ENTRY org.eclipse.core.resources 4 2 2018-09-27 08:11:22.981
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.nio.file.ClosedFileSystemException
  at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1105)
  at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.checkAccess(ZipFileSystem.java:332)
  at jdk.zipfs/jdk.nio.zipfs.ZipPath.checkAccess(ZipPath.java:830)
  at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.checkAccess(ZipFileSystemProvider.java:185)
  at java.base/java.nio.file.Files.exists(Files.java:2439)
  at org.eclipse.jdt.internal.core.builder.ClasspathMultiReleaseJar.findClass(ClasspathMultiReleaseJar.java:206)
  at org.eclipse.jdt.internal.core.builder.ClasspathLocation.findClass(ClasspathLocation.java:58)
  at org.eclipse.jdt.internal.core.builder.NameEnvironment.findClass(NameEnvironment.java:524)
  at org.eclipse.jdt.internal.core.builder.NameEnvironment.findType(NameEnvironment.java:556)
  at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.fromSplitPackageOrOracle(LookupEnvironment.java:414)
  at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.lambda$1(LookupEnvironment.java:289)
  at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForTypeFromModules(LookupEnvironment.java:384)
  at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:288)
  at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:262)
  at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:530)
  at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkAndSetImports(CompilationUnitScope.java:254)
  at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:501)
  at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:868)
  at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:394)
  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
  at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:386)
  at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:214)
  at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:318)
  at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:79)
  at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:265)
  at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:185)
  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:798)
  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:219)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:262)
  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:315)
  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:318)
  at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:370)
  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:391)
  at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
  at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

没有办法阻止它。至少 Eclipse 没有冻结,所以我点击了应用程序标题栏上的“关闭”按钮并设法退出程序。我可以回到程序中,但是当我尝试构建它时,它会进入同一个无限循环。

4

1 回答 1

2

错误 539536中所述,此问题已在 Java 11 支持补丁的最新版本中得到修复。该问题是由从ZipFile迁移到java.nio类引起的,这些更改目前已恢复,但在撰写本文时仍在讨论中。

要安装此修复程序,请在 Eclipse 中使用以下更新站点并选择v20181001-0921或更新版本:http: //download.eclipse.org/eclipse/updates/4.9-P-builds/P20181001-0525/

于 2018-10-03T07:39:03.157 回答