<div dir="ltr">Hello!<br><div><br></div><div>I'm playing with module imports and tried to import <a href="http://java.se" target="_blank">java.se</a> module:</div><div><br></div><div>import module <a href="http://java.se" target="_blank">java.se</a>;<br><br>class Test {<br>  void main() {<br>    ArrayList<String> list;<br>  }<br>}<br></div><div><br></div><div>Building (23-ea+31-2337) yields the following errors:</div><div><br></div><div>>\jdks\jdk-23\bin\java.exe --enable-preview --source=23 Test.java<br>Test.java:1: error: unnamed module does not read: <a href="http://java.se" target="_blank">java.se</a><br>import module <a href="http://java.se" target="_blank">java.se</a>;<br>^<br>Test.java:5: error: cannot find symbol<br>    ArrayList<String> list;<br>    ^<br>  symbol:   class ArrayList<br>  location: class Test<br>2 errors<br>error: compilation failed<br></div><div><br></div><div>I'm not sure I understand the first error "unnamed module does not read". Importing <a href="http://java.se" target="_blank">java.se</a> is described in JEP 476 text [1], so I assume that it's something allowed. Is the current behavior intended? If yes, then the JEP text should probably not mention <a href="http://java.se" target="_blank">java.se</a> as an allowed example to import.</div><div><br></div><div>The second error is caused by the fact that <a href="http://java.se" target="_blank">java.se</a> does not declare explicitly that it transitively requires java.base. It's assumed that any module requires java.base implicitly, and requires transitive java.base declaration is not allowed. However, this looks strange with <a href="http://java.se" target="_blank">java.se</a> specifically: we can import the whole Java SE platform via a single import declaration _except_ the java.base module. Contrary, running jshell JAVASE imports the whole Java SE platform including the java.base module. This looks inconsistent to me.</div><div><br></div><div>So the question is: is it actually allowed to import <a href="http://java.se" target="_blank">java.se</a>, and should it import java.base automatically?</div><div><br></div><div>With best regards,</div><div>Tagir Valeev</div><div><br></div><div>[1] <a href="https://openjdk.org/jeps/476" target="_blank">https://openjdk.org/jeps/476</a></div></div>