1

In Intellij, I have a java project that I would like to use (add it as a dependency) in multiple other java projects.

I've tried "Project Structure >> Libraries" and adding the project. This gives no errors, and even allows auto complete of classes and auto import of the packages from this library.

However, when I run the code it complains "package [...] does not exist." Is there any way to import an existing project?

bcorso
  • 45,608
  • 10
  • 63
  • 75
  • How exactly are you compiling your project? Are you using a build system such as Maven or Gradle? – yole Mar 13 '15 at 18:34
  • Yes, I am using Gradle. I eventually got this to work by creating two separate projects and then importing the project as a module instead of a library. – bcorso Mar 14 '15 at 15:54

0 Answers0