Ok, so I'm trying to learn java 9 trough a book I bought, but when I try to compile a module trough the cmd, I get this error message. image of the cmd compile error
I have been trying to understand what is happening for the last 2 days.
Ok, so I'm trying to learn java 9 trough a book I bought, but when I try to compile a module trough the cmd, I get this error message. image of the cmd compile error
I have been trying to understand what is happening for the last 2 days.
The problem in the screenshot you posted is that --module-source-path
requires a path, identifying where the modules' source files are, so that it can compile them. Since you haven't specified where the source files are, the compiler is complaining about it.
If the project structure is
modulename/src/main/java/module-info.java
modulename/src/main/java/com/whatever/Main.java
then the command to compile it would be (run from the parent of project
)
javac -d outputfolder --module-source-path "./*/src/main/java" -m modulename
The *
symbolizes the module's directory.
I suggest you go through the examples in your book by following the tutorial before experimenting.