简体   繁体   中英

Intellij: Java 11: export module: package not found {module not found}, module-info.java

I'm trying to create a simple modular programming application.

My project consists of two modules-

  1. com.module.model

  2. com.module.util

when I'm trying to export the module com.module.model in module-info.java.

IntelliJ cannot find the package to import .

(However it should give me the error of module not found)

The same problem stands for 'requires module' too.

I have provided all the modules in the dependencies for com.module.model

com.module.model

模块依赖

Solutions I already tried-

  1. Build the modules separately (before adding the export line) and the whole project (maven clean install) as whole.

  2. Invalidated caches and restarted.

  3. SDK and Language level is set to 11.

You need to create those packages com.module.model and the like within the java folder of your IntelliJ project.

Within IntelliJ, the directory that you've named as com.module.model is the "IntelliJ module" name and has no relation with the "Java module system", in that you would be using the artifact generated out of this project.

To add a screenshot on the similar lines as of the question. It would look like:

在此处输入图像描述

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