尝试运行程序时netbeans出错:已截断的模块信息. class

iyzzxitl  于 2022-11-10  发布在  其他
关注(0)|答案(1)|浏览(156)

我在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)

我不知道为什么会发生这种情况,我以前运行这个项目没有任何问题,但后来我开始创建一些类,之后我不能再运行它。所以我把项目回滚到开始,到它工作的点,但现在它不工作了。

56lgkhnf

56lgkhnf1#

解决办法是:
您使用的是哪个版本的Java?Java 10中有一个InvalidModuleDescriptorException的修复程序,不过很明显,这不一定与您的问题有关。正如前面的评论中所建议的,只需选择项目节点,右键单击并选择Clean and Build。这样就修复了问题吗?- skomisa

相关问题