2

I am working on a java based project in IntelliJ IDEA, I assume I have an issue with my project setup...

The project consists of the "modules" (maybe I miss use that feature?):

  • a library meant to be the common base for the two following modules
  • a spring boot based test application
  • an android app

I succeeded in getting the library to build, creating a jar.

However I fail to build the spring application, I receive this error:

error: package org.XXXX.XXX.lib.config does not exist
import org.XXXX.XXX.lib.config.Config;

where org.XXXX.XXX.lib.config.Config refers to a class in the library and org.XXXX.XXX.lib.config is defined as a package in that library.

The funny thing: the parser succeeds, auto unclusion (Alt-Enter) succeeds in finding the class, creates the import statement, no errors or warnings are shown in the editor. So the code inspection is happy. But then at build time above error is thrown.

To be able to use that library in the spring application I added the libraries source folders to the module implementing the spring application in IDEA's project settings. Also I added the created jar file and the library itself as a module dependency (which probably is all wrong...).

This is my first non trivial, private java based project and I have to acknowledge that I am a but at a loss. I don't really know how to proceed, how to tackle down that issue.

Anyone got a hint for me?

arkascha
  • 41,620
  • 7
  • 58
  • 90
  • Have you added the library to your build path? – nbokmans May 19 '18 at 12:46
  • @nbokmans I though that is what I did with adding it to the dependencies in the module settings? Apparently not, so how do I do that? – arkascha May 19 '18 at 12:47
  • @arkascha Do you happen to have other projects open (that might have the class)? – NiVeR May 19 '18 at 12:50
  • @NiVeR No, only the one mentioned here. – arkascha May 19 '18 at 12:51
  • https://stackoverflow.com/questions/16742085/adding-jar-files-to-intellijidea-classpath?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – NiVeR May 19 '18 at 12:54
  • @NiVeR That question appears to refer to copying `jar` archives of external libraries to a project. I do not see the immediate connection... But I will go on looking through the documents linked in the answers. So thanks! – arkascha May 19 '18 at 13:07

0 Answers0