title: Modular java module not found
body: <p>I read all of the modular documentation but still cannot figure out what the problem is here: I added a dependency via Maven (I also tried adding the jar into project library manually but still caused the same problem), but when I import the class from that particular into my class, IntelliJ says "package com.fazecast.jSerialComm is declared in module 'com.fazecast.jSerialComm' but module com.greeting does not read it".</p>
  
  <p>It gives me two options: Either add it as Maven dependency which I already did (it is in my pom.xml and can see it under dependencies) or "add requires com.fazecast.jSerialComm directive to module-info.java". If I add <code>requires com.fazecast.jSerialComm</code>, it compiles fine, but when I create my modular jar and try to run the jar with <code>java -p mods/ -m com.greeting/com.mayapp.Runner</code>, it tells me "java.lang.module.FindException: Module com.fazecast.jSerialComm not found, required by com.greeting".</p>
  
  <p>I also tried more jars/dependencies which I have and it gave me the same problem. I tried Java 9 and 10, also with Gradle, and created artifact via IntelliJ. Got the same exception. My <code>module-info.java</code> is in <code>src/main/java</code> as where my app starts. Any help will be highly appreciated.</p>
  
  <pre><code>   Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
      Maven home: C:\Apache\apache-maven-3.5.4-bin\apache-maven-3.5.4\bin\..
      Java version: 9.0.4, vendor: Oracle Corporation, runtime: C:\Program iles\Java\jdk-9.0.4 Default locale: en_US, platform encoding: Cp1252
      OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
      Intelli J 2018.1.6
  
      &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  
      http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.myapp&lt;/groupId&gt;
      &lt;artifactId&gt;greet&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.7.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;10&lt;/source&gt;
                      &lt;target&gt;10&lt;/target&gt;
                      &lt;release&gt;9&lt;/release&gt;
                      &lt;executable&gt;javac10&lt;/executable&gt;
                      &lt;compilerArgs&gt;
                          &lt;arg&gt;-Xlint:all,-processing&lt;/arg&gt;
                      &lt;/compilerArgs&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fazecast&lt;/groupId&gt;
              &lt;artifactId&gt;jSerialComm&lt;/artifactId&gt;
              &lt;version&gt;2.0.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  
  
      package com.myapp;
  
      import com.fazecast.jSerialComm.SerialPort;
      public class Runner {
       public static void main(String[] args) {
          System.out.println("Runner");
       }
      }
  
  
      module com.greeting {
      requires com.fazecast.jSerialComm;
      }
  </code></pre>