JDK isn't specified for module
时间: 2023-09-29 13:02:46 浏览: 352
Java:jdk1.8
This error message usually occurs when you are trying to compile a module in Java without specifying the version of the JDK to be used.
To fix this issue, you need to explicitly set the JDK version in your module. You can do this by adding the following line to your module-info.java file:
```
open module yourModuleName {
requires java.version;
}
```
Replace `yourModuleName` with the name of your module, and `java.version` with the version of the JDK you want to use (e.g., `requires java.base`).
Once you've specified the JDK version in your module-info.java file, you should be able to compile your module without any issues.
阅读全文