java - 尝试运行程序 : Truncated module-info. 类时出现 netbeans 错误

标签 java exception netbeans

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

相关文章:

php - "Go to declaration"在 Netbeans PHP 中不起作用

java - GWT - 如何组织项目以拥有多个网页和它们之间的导航

java - 使用 @Autowire 链接我的 @Service 类和 @Repository 类会导致错误。似乎找不到解决方案

java - 为什么 System.out.println() 中不需要 java.io.PrintStream?

java - 如何创建一个存储过程,由客户端应用程序在具有给定参数的表中搜索记录并返回找到的行数据?

Netbeans 中的 JavaScript

java - OpenJPA 增强 Spring ROO 批处理应用程序

线程中的 Java 异常

Java:ArrayStore异常

exception - EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)与 dataTaskWithUrl