Eclipse 2018-09使用Java 11插件进入了无限的构建循环:ClosedFileSystemException

时间:2018-09-27 15:24:00

标签: java eclipse maven java-11 eclipse-2018-09

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

我想使用Java 11的新功能,因此首先我将编译器源/目标从Java 8更改为Java11。它仍然在命令行上使用Maven构建了find,但是无法在Eclipse中进行编译(请参见{{ 3}})。

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

现在Eclipse进入了一个无休止的循环,在完成率提高了8%到完成率提高了9%之间跳跃,出现了反复无休止的错误,例如:

!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不会冻结,因此我点击了应用程序标题栏上的“关闭”按钮,并设法退出了程序。我可以重新进入该程序,但是当我尝试构建它时,它会进入相同的无穷循环。

1 个答案:

答案 0 :(得分:2)

Bug 539536中所述,此问题已在最新版本的Java 11支持补丁中得到解决。该问题是由于从 ZipFile 迁移到 java.nio 类而引起的,目前已经恢复了更改,但在撰写本文时仍在进行讨论。

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