我在 Linux Mint 和 Git 上使用 Apache Netbeans 9.0。我有一个名为 PowerCal 的 java 项目,在尝试运行它时,出现以下错误:
run:
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: /<PATHTOMYPROJECT>/PorwerCal/build/classes
Caused by: java.lang.module.InvalidModuleDescriptorException: Truncated module-info.class
/home/<myusername>/.cache/netbeans/9.0/executor-snippets/run.xml:111: The following error occurred while executing this line:
/home/<myusername>/.cache/netbeans/9.0/executor-snippets/run.xml:68: Java returned: 1
BUILD FAILED (total time: 0 seconds)
我不知道为什么会发生这种情况,我之前运行这个项目没有任何问题,但后来我开始创建一些类,之后我无法再次运行它。所以我把项目回滚到开始,直到它可以工作,但现在它不起作用了。
最佳答案
解决办法是这样的:
Which version of Java are you using? There is a fix for an InvalidModuleDescriptorException in Java 10, though obviously that does not necessarily relate to your problem. As suggested in the previous comment, just select the project's node, right click and select Clean and Build. Does that fix the issue? – skomisa
关于java - 尝试运行程序 : Truncated module-info. 类时出现 netbeans 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52524219/