OrangePot
OrangePot

Reputation: 1082

Import package from other intelliJ project

I have a development folder with the following folders (projects) inside it:

development: { baseByBase, vgo, virology-lib2}

Files in virology-lib2 are packaged with package ca.virology.lib2..;

Files in vgo are packaged with package ca.virology.vgo..;

So in my baseByBase project importing from virology-lib2 with import ca.virology.lib2...; works.

I want to import classes similarly from vgo into baseByBase, but import ca.virology.vgo..; doesnt work (cannot resolve symbol vgo). How do i import vgo classes into baseByBase? Why did it work for one import and not the other?

Upvotes: 0

Views: 5934

Answers (1)

Ivaylo D. Ivanov
Ivaylo D. Ivanov

Reputation: 3859

In IDEA terms, you have a project with three modules in it. In order one of them (baseByBase) to import classes from the others, it must depend either on the modules or on their output (jars). The third, ugly option is baseByBase module to have among its configured "source" folders a folder from another module (virology-lib2).

So open "File > Project Structure", and add "vgo" as a module dependency to the "baseByBase" module (see example in the screenshot below).

enter image description here

Upvotes: 1

Related Questions