It seems that this is related to how Java 9 tries to support encapsulation for real, in contrast to how it was done in the past. It could have happened that your internal classes were exposed to consumers, because your the public API used those internal classes. Sun internal packages had a similar issue.
There are three topics in the modularity story for Java 9:
- Modularize the JDK and JRE
- Hide platform internals (e.g. sun.misc)
- A module system for application developers
http://paulbakker.io/java/java-9-modularity/
For your specific case, the sun internal modules are not available for import by default and that is a good thing.
That said, modules can be added to JShell thanks to a fix.
There should be "add modules" support as well as "add exports" and
"module path", to allow people to explore their own modular code.
https://bugs.openjdk.java.net/browse/JDK-8166649
You want to track that bug ticket to see when this fix is available.
It was just resolved 4 days ago.