0

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.

Arnaut
  • 1
  • 1
    Yes, an argument for module-source-path is missing. You specify the switch but forgot to add the path. – Melvin Dec 08 '20 at 11:44
  • Try this link: https://openjdk.java.net/projects/jigsaw/quick-start - maybe a slightly different point of view will help. – Peter Hull Dec 08 '20 at 14:15
  • 1
    Don’t post images of errors. Copying the text into the browser is easier than making a screenshot. – Holger Dec 09 '20 at 11:48

1 Answers1

0

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.

Thirumalai Parthasarathi
  • 4,541
  • 1
  • 25
  • 43