David S.
David S.

Reputation: 117

Setting up common classes for access from other projects

I'm trying to set up two Java projects to have access to classes in another Java project. So far, the situation is visible in the following image:

projects
(source: shrani.si)

However, I can't seem to import any classes from the Common project.

common lowercase
(source: shrani.si)

common uppercase

I could just have multiple packages in a single project, but as far as I know only 1 jar can be compiled per project.

Any help is greatly appreciated.

Upvotes: 0

Views: 124

Answers (1)

Aleksandr Podkutin
Aleksandr Podkutin

Reputation: 2570

You need to add your "Common" project to libraries of project where you need to use classes from "Common" project.

For example right-click on "Clinet" project then "Properties" In right menu choose "Libraries" and press button "Add Project..." and double-click on project "Common".

After that you can add import common.Item;

Also try to clean and build all your projects.

Upvotes: 1

Related Questions