Why do we need requires static in java-9 module system? [duplicate]
This question already has an answer here: What's the difference between requires and requires static in module declaration 2 answers Does the Java 9 Module system support optional dependencies? 1 answer I started to learn jigsaw java-9 feature and read some articles/video. I can't understand concept of optional dependencies( requires static ) quote from article : When a module needs to be compiled against types from another module but does not want to depend on it at run time, it can use a requires static clause. If foo requires static bar, the module system behaves different at compile and