Module is not in dependencies Intellij IDEA 2017.2.5 Java 9
Asked Answered
G

1

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?

Geraldine answered 30/9, 2017 at 18:2 Comment(0)
D
13

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

enter image description here

Dorsett answered 30/9, 2017 at 18:6 Comment(3)
How I can add manually in intellij IDEA? and also why it is not adding automatically? why it showing the error and required ALT+ENTER to solve it.Geraldine
@UnKnown Updated the answer.Dorsett
"Add dependency" means to click the "+" icon in the bottom left, select "Module Dependency" and choose the module you need to depend on.Cletis

© 2022 - 2024 — McMap. All rights reserved.