这是我的项目结构:
⇒ tree
.
├── out
│ └── easytext
│ ├── javamodularity
│ │ └── easytext
│ │ └── Main.class
│ └── module-info.class
└── src
└── easytext
├── javamodularity
│ └── easytext
│ └── Main.java
└── module-info.java
Main.java:
package javamodularity.easytext;
import java.io.IOException;
public class Main {
public static void main(String... args) throws IOException {
System.out.println("hello");
System.in.read();
}
}
module-info.java:
module easytext {
requires java.base;
}
内部版本:
javac --module-source-path src -d out $(find . -name "*.java")
尝试运行:
cd out
java --module-path out -m easytext/javamodularity.easytext.Main
Error occurred during initialization of boot layer
java.lang.module.FindException: Module easytext not found
我该如何解决?