0

I have noticed that once I use the --module-path command, I have to use it again when compiling the same java file.

Is this because the --module-path command appends to the module path temporarily ? If so, is there a way to set the --module-path permanently?

Omid
  • 5,823
  • 4
  • 41
  • 50
Mahamed Ducale
  • 119
  • 1
  • 8
  • 1
    The value of `--module-path` is scoped to the invocation of the tool (e.g. `javac`) or application (e.g. `java`) you're running. – Slaw May 31 '19 at 00:40
  • Does this mean that once javac/java is exited, the value of --module-path held is not remembered? – Mahamed Ducale May 31 '19 at 01:17
  • Yes, that means the value is lost when the process exits and the memory is released. Same as all the other command line options. However, you could put the value in a file and use `@filename` on the command line. See [the documentation](https://docs.oracle.com/en/java/javase/12/tools/javac.html#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9). – Slaw May 31 '19 at 09:09

0 Answers0