I created two small projects de.app1 and de.app2, where App from de.app1 uses Test from de.app2.
├── de.app1
│ ├── de
│ │ └── app
│ │ └── App.java
│ └── module-info.java
└── de.app2
└── de
└── test
└── Test.java
module-info.java in the first project just contains module de.app1 {}
I compiled the second project and created a jar file:
javac de/test/Test.java
jar cf app2.jar de/test/Test.class
and then tried to compile the first project like this:
javac -cp ../de.app2/app2.jar de/app/App.java module-info.java
which failed because Test could not be found. When I compile the project without module-info.java, everything is working as usual.
Is it somehow possible to use classes from a jar that is not a Java 9 module within a Java 9 module? Especially for projects that depend on 3rd-party projects (e.g. apache-commons,...), I think something like this would be required.