title: Error occurred during initialization of boot layer java.lang.module.FindException - Java 9 +Eclipse Oxygen
body: <p>I am struggling to get my Eclipse able to run and debug a simple Java 9 application. I have found several suggestions and I have tried all of them without any success. To summarize, here are all I have read in the last 5 hours:</p>
  
  <ul>
  <li>in Java 9 you can't use package_name/something/*.jar (the issue is pointed to be *.jar)</li>
  <li>you must setup Java 9 in eclipse.ini</li>
  <li>you must place module-info.java under src directory</li>
  <li>you setup jre instead of jdk in (Preference>Installed JREs>Add...)</li>
  </ul>
  
  <p>The closest question I found to mine is <a href="https://stackoverflow.com/questions/44403070/how-do-i-add-modules-to-the-eclipse-oxygen-module-path-for-a-project">How do I add modules to the Eclipse Oxygen module path for a project?</a> but without accepted answer and it seems to be older than current Eclipse version.</p>
  
  <p>In fact, I can compile successfully both in Eclipse (right click>run as>Maven install...) or using mvn clean package install straight from command line. Nevertheless, I can run the application straight from command line but I can't run it from Eclipse. I do consider this usefull since the next step will be debug.</p>
  
  <p>The simple application is downlowaded from <a href="https://examples.javacodegeeks.com/core-java/java-9-httpclient-example/" rel="nofollow noreferrer">https://examples.javacodegeeks.com/core-java/java-9-httpclient-example/</a></p>
  
  <p>I made only two changes in the original application pom (see <a href="https://stackoverflow.com/questions/48053904/failed-to-execute-maven-compiler-plugin3-6-1testcompile-when-using-java-9">Failed to execute maven-compiler-plugin:3.6.1:testCompile when using java 9</a> for deeper details). I just upgraded maven-compiler-plugin-version to 3.7 and maven-compiler-plugin I changed from 1.9 to 9 and then I can compile it in Eclipse.</p>
  
  <p>Here is my current eclipse.ini where I manually changed the java version:</p>
  
  <pre><code>-startup
  plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
  --launcher.library
  C:\Users\dca\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
  -product
  org.eclipse.epp.package.jee.product
  -showsplash
  org.eclipse.epp.package.common
  --launcher.defaultAction
  openFile
  --launcher.appendVmargs
  -vm
  C:\Program Files\Java\jre-9.0.1\bin
  -vmargs
  -Dosgi.requiredJavaVersion=1.9
  -Dosgi.instance.area.default=@user.home/eclipse-workspace
  -XX:+UseG1GC
  -XX:+UseStringDeduplication
  --add-modules=ALL-SYSTEM
  -Dosgi.requiredJavaVersion=1.9
  -Xms256m
  -Xmx1024m
  --add-modules=ALL-SYSTEM
  -Declipse.p2.max.threads=10
  -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
  -Doomph.redirection.index.redirection=index:/-&gt;http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
  </code></pre>
  
  <p>Here is how I successfully run the application:</p>
  
  <pre><code>C:\_EclipseJava9\WSs\ws\java9-http-client\target&gt;java -jar --add-modules=jdk.incubator.httpclient http_client-0.0.1-SNAPSHOT.jar
  WARNING: Using incubator modules: jdk.incubator.httpclient
  Running synchronous HTTP Client examples
  </code></pre>
  
  <p>Assuming I shoud setup "--add-modules=jdk.incubator.httpclient" in Eclipse I tried it without success:</p>
  
  <p><a href="https://i.stack.imgur.com/kQdUH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kQdUH.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>Edited</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/kGqZA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kGqZA.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/u2voX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u2voX.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/U4gHr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U4gHr.png" alt="enter image description here"></a></p>