简体   繁体   English

Eclipse 项目构建未能为 jre/lib/jrt-fs.jar 初始化 ct.sym

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

This has been a nightmare lately to setup Eclipse 2020 for some demo servlet.最近为某些演示 servlet 设置 Eclipse 2020 一直是一场噩梦。

The project structure is:项目结构为:

文件结构

The demo servlet dies with "Http Status 500 - Error instantiating servlet class" with the root cause as "java.lang.ClassNotFoundException".演示 servlet 因“Http 状态 500 - 实例化 servlet 类时出错”而终止,根本原因为“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未能为 C:\\Users\\Pratyay Mukherjee\\AppData\\Local\\Temp\\eoi8BAC.tmp\\plugins\\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v202008155 初始化 ct.sym -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.我一次又一次地尝试重建项目,因为这是解决 Eclipse 一切问题的方法。 What is going wrong in my project and how can I get the servlet to work without errors?我的项目出了什么问题,如何让 servlet 正常工作?

The following fixed the issue for me.以下为我解决了这个问题。

  • Installed OpenJDK 15.0.1 on my computer.在我的电脑上安装了 OpenJDK 15.0.1。
  • In Window/Preferences/Java/Installed JREs, I added a link to the new Java version (and named it "openjdk-15" to help identify it).在 Window/Preferences/Java/Installed JREs 中,我添加了一个指向新 Java 版本的链接(并将其命名为“openjdk-15”以帮助识别它)。 I unchecked the existing jre and selected the newly installed.我取消选中现有的 jre 并选择了新安装的。
  • I started a NEW PROJECT, and for the JRE, made sure to select the new default jre.我开始了一个新项目,对于 JRE,确保选择新的默认 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/https://www.eclipse.org/forums/index.php/t/1106241/

如果有人对 Eclipse 中的 java.lang.ClassNotFoundException 感到沮丧, 这篇文章可能会有很大帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于“无法为 C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar 初始化 ct.sym ”在 IDE Z32F752202966496E8966 中,该项目未构建 - The project was not built due to "Failed to init ct.sym for C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar" in IDE Eclipse 在Eclipse中为项目构建设置JRE - Setting JRE for project build in Eclipse Eclipse - 无法将 jar 添加到构建路径。 jar 在项目的 lib 文件夹内,但不可见 - Eclipse - cant add jar to build path. jar is inside the lib folder of project, but not visible 在Eclipse中自动将项目构建到JAR中 - Build project into a JAR automatically in Eclipse 如何在Eclipse中将项目的jar版本添加到项目中? - How to add a jar build by a project to the project in eclipse? 如何在Eclipse中为Maven聚合器项目构建定义JRE? - How to define the JRE for a Maven aggregator project build in Eclipse? m2eclipse无法找到C:\ Program Files \ Java \ jre6 \ .. \ lib \ tools.jar - m2eclipse is unable to locate C:\Program Files\Java\jre6\..\lib\tools.jar 强制JAVA项目使用.java文件而不是JRE lib .class文件(使用Eclipse) - Force JAVA project to use .java files instead of JRE lib .class files (with Eclipse) 如何在Eclipse项目中为lib附加源而没有“ sources JAR”? - How to attach source in Eclipse project for lib with no “sources JAR”? Jar项目是否位于lib项目中? - Jar inside a lib project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM