英文:
Enhanced Class Decompiler is installed still I am unable to decompile .class to .java source?
问题
Enhanced Class Decompiler已安装,但我仍然无法将.class文件反编译为.java源代码。
我正在尝试反编译Java核心类 - Collections.class - 有人可以指导我如何解决这个问题吗?
我正在使用STS 4.8.x版本。
英文:
Enhanced Class Decompiler is installed still I am unable to decompile .class to .java source?
I am trying to decompile java core class - Collections.class - Could some one guide me how to get past this.
答案1
得分: 1
根本原因是 Spring Tools 4 中嵌入的 JDK 不包含源代码。Spring Tools 4 应用程序附带了一个来自 Eclipse JustJ 的嵌入式 JDK,这是一个新功能,但缺少源代码是一个问题,可能会在即将发布的版本中得到解决(根据 STS4 主要开发者在这条推文中所说)。
作为解决方法(也是解决嵌入式 JDK 缺少源代码问题的变通方法),确保在您的系统中安装了 JDK(而不是 JRE)(如果缺少,可以从 AdoptOpenJDK 下载 JDK),并在Java > Installed JREs的首选项中进行配置。
使用反编译方法的缺点是将缺少 Javadoc。
英文:
The root cause is that the JDK embedded in the Spring Tools 4 does not contain sources. That the Spring Tools 4 application is shipped with an embedded JDK (from Eclipse JustJ) is currently a new feature, but the missing sources is an issue that will probably be fixed in an upcoming release (according to this tweet by the STS4 main developer).
As solution (and workaround for the missing sources of the embedded JDK), make sure a JDK (not a JRE) is installed in your system (if missing, you can download a JDK e.g. from AdoptOpenJDK) and configure it in the preferences in Java > Installed JREs.
Using the decompiler hack has the disadvantage that the Javadoc will be missing.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论