Eclipse项目构建无法初始化jre/lib/jrt-fs.jar的ct.sym。

huangapple go评论68阅读模式
英文:

Eclipse project build failed to init ct.sym for jre/lib/jrt-fs.jar

问题

这段时间为了设置Eclipse 2020来展示一些演示的Servlet,真是一场噩梦。

项目结构如下:

(图片)

这个演示Servlet出现了“Http状态500 - 错误实例化Servlet类”的问题,根本原因是“java.lang.ClassNotFoundException”。

在我的项目旁边有一个红叉,并且有一个错误日志,内容是:

> Failed to init ct.sym for C:\Users\Pratyay Mukherjee\AppData\Local\Temp\eoi8BAC.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v20200815-0932\jre\lib\jrt-fs.jar

我尝试过一次又一次地重新构建项目,因为这对于Eclipse中的任何问题都是解决方案。我的项目出了什么问题?我如何才能使Servlet在没有错误的情况下工作?

英文:

This has been a nightmare lately to setup Eclipse 2020 for some demo servlet.

The project structure is:

Eclipse项目构建无法初始化jre/lib/jrt-fs.jar的ct.sym。

The demo servlet dies with "Http Status 500 - Error instantiating servlet class" with the root cause as "java.lang.ClassNotFoundException".

There is a red cross beside my project and an error log stating:

> Failed to init ct.sym for C:\Users\Pratyay Mukherjee\AppData\Local\Temp\eoi8BAC.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v20200815-0932\jre\lib\jrt-fs.jar

I have tried rebuilding the project again and again as that is the solution for everything wrong with Eclipse. What is going wrong in my project and how can I get the servlet to work without errors?

答案1

得分: 1

以下方法解决了我的问题。

  • 在我的计算机上安装了OpenJDK 15.0.1。
  • 在Window/Preferences/Java/Installed JREs中,我添加了一个指向新Java版本的链接(并将其命名为“openjdk-15”以帮助识别它)。我取消选中了现有的JRE,并选择了新安装的JRE。
  • 我启动了一个新项目,并确保选择了新的默认JRE。
  • 我将原本失败的项目的源代码复制到了新项目中。

请参阅https://www.eclipse.org/forums/index.php/t/1106241/。

英文:

The following fixed the issue for me.

  • Installed OpenJDK 15.0.1 on my computer.
  • In Window/Preferences/Java/Installed JREs, I added a link to the new Java version (and named it "openjdk-15" to help identify it). I unchecked the existing jre and selected the newly installed.
  • I started a NEW PROJECT, and for the JRE, made sure to select the new default jre.
  • I copied over the source code of the failing project into the new project.

See https://www.eclipse.org/forums/index.php/t/1106241/

huangapple
  • 本文由 发表于 2020年10月28日 02:16:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/64560582.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定