Files
javademos/jep511/output/04-what-a-module-import-brings-in.txt
T
Claude 96b25c8fc4 jep511: add the star-import clash demo, java.base export count and a java.time jshell check
TwoStarImports.java, the java.base export count in output/04, the extra LocalDate line in src/imports.jsh and regenerated transcripts. Additive commit.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
2026-09-24 11:42:45 +00:00

75 lines
2.1 KiB
Plaintext

$ java --describe-module java.base | grep -c '^exports' (25.0.4.1+1-LTS)
58
$ java --describe-module java.sql (25.0.4.1+1-LTS)
[email protected]
exports java.sql
exports javax.sql
requires java.transaction.xa transitive
requires java.base mandated
requires java.xml transitive
requires java.logging transitive
uses java.sql.Driver
$ java --describe-module java.se | grep -c 'requires' (25.0.4.1+1-LTS)
20
$ java --describe-module java.se | grep -c exports (25.0.4.1+1-LTS)
0
$ javac src/Transitive.java && java Transitive (25.0.4.1+1-LTS)
demo
0
java.xml
[java.base needed its own import]
$ javac src/Transitive.java && java Transitive (27+35)
demo
0
java.xml
[java.base needed its own import]
$ javac broken/SqlDoesNotGiveBase.java (25.0.4.1+1-LTS)
broken/SqlDoesNotGiveBase.java:5: error: cannot find symbol
List<String> l = List.of("x"); // java.util.List lives in java.base
^
symbol: class List
location: class SqlDoesNotGiveBase
broken/SqlDoesNotGiveBase.java:5: error: cannot find symbol
List<String> l = List.of("x"); // java.util.List lives in java.base
^
symbol: variable List
location: class SqlDoesNotGiveBase
2 errors
$ javac broken/SqlDoesNotGiveBase.java (27+35)
broken/SqlDoesNotGiveBase.java:5: error: cannot find symbol
List<String> l = List.of("x"); // java.util.List lives in java.base
^
symbol: class List
location: class SqlDoesNotGiveBase
broken/SqlDoesNotGiveBase.java:5: error: cannot find symbol
List<String> l = List.of("x"); // java.util.List lives in java.base
^
symbol: variable List
location: class SqlDoesNotGiveBase
2 errors
$ javac src/JavaSe.java (25.0.4.1+1-LTS)
src/JavaSe.java:1: error: unnamed module does not read: java.se
import module java.se;
^
1 error
$ javac src/JavaSe.java (27+35)
src/JavaSe.java:1: error: unnamed module does not read: java.se
import module java.se;
^
1 error
$ javac --add-modules java.se src/JavaSe.java && java JavaSe (25.0.4.1+1-LTS)
[a] x 0
$ javac --add-modules java.se src/JavaSe.java && java JavaSe (27+35)
[a] x 0