Unrecognized option: -modulepath

JLP picture JLP · Oct 5, 2016 · Viewed 9.4k times · Source

Is anyone else having this issue when they run the module it complains about this in java 9 mac version?

Below is the issue!

Unrecognized option: -modulepath
Error: Could not create the Java Virtual Machine.

How to reproduce ? I am doing this example. The last step is to run the module using below command. That's when i see the issue.

java -modulepath mods -m com.mycompany.helloworld/com.mycompany.helloworld.HelloWorld

Here is some background information. . I started playing with java 9 (mac version).

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+138)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+138, mixed mode)

I can not even uninstall the java 9 properly. But, I will solve that later.

any help will be appreciated!

Answer

Stanislav Lukyanov picture Stanislav Lukyanov · Oct 24, 2016

As Joop Eggen have said, there is an effort in the JDK to standardize the command-line options and use the GNU-style --starting-with-double-dash-and-dash-separated-long-options. So yes, --module-path is what you're looking for.

For the reference: