且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IntelliJ在编译时找不到依赖关系,但可以在编辑器中找到。

更新时间:2023-11-18 18:36:28

您已经添加了一个文件夹,用于依赖(不是jar或模块),其中包含源代码和编译类。这是完全合法的,显然IDEA设法识别源文件夹,但是对于类文件夹却失败。

You had added a folder for dependency (not a jar or module) with sources and compiled classes in it. This is perfectly legal and obviously IDEA managed to recognize the source folder but failed for the classes folder.

按照您选择的依赖项(绿色铅笔图标)按编辑。打开的对话框显示类和源文件夹。添加类和包所在的确切文件夹(而不是根项目文件夹)。

Press "Edit" on your selected dependency (the green pencil icon). The dialog that opens show "Classes" and "Sources" folders. Add the exact folder in which the classes and packages are (not the root project folder).