简体   繁体   中英

Module is not in dependencies Intellij IDEA 2017.2.5 Java 9

I just tested my java 9 module understanding in command line. Then I moved to Intellij IDEA 2017.2.5 to test it. There I am facing the error module is not in dependencies Don't know why intellij is showing the error.

I just write required statements in module-info.java as exports and requires .

Then I use Intellij intelligence to solve the error self by IDEA. Just ALT+ENTER then I click on Add dependency on module 'module-name-here' . But I don't know what Intellij doing behind the scene. Any idea about it?

But I don't know what Intellij doing behind the scene. Any idea about it?

Its adding the modules to the module path of your current module. This is very similar to adding libraries/dependencies to classpath until Java8 to use the imports .

The same can be done manually using the following steps:-

~> Project Settings 
~> Modules > Select module you want to add dependency to
~> Dependencies > Add dependency

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM