1

What I'm doing seems to me quite simple but it's just not working out. This has a lot to do with me being a novice to java and eclipse.

I want to reference another project(call it javalibproject) from my eclipse project (call it mainproject) . So i add javalibproject to the projects tab in in the java build path of mainproject and also add a project reference to it.

What i was hoping at this stage is that i would be able to import the javalibproject package and declare one of the referenced classes. But in my class in mainproject, i get javalibproject cannot be resolved to a type. I would have also expected some sort of library folder displayed in package explorer showing javalibproject (similar to what happens when you reference an external jar).

Any ideas what i'm doing wrong? WOuld i be best off trying to export javalibproject as a JAR and reference that.

Thanks,

Eoin

2 Answers 2

2

You need to add that project to main project build path.

On your main project -> properties -> java build path -> projects -> add.

For second solution (add it as jar) look at Apache Maven as it will save you lot of time.

Sign up to request clarification or add additional context in comments.

Comments

0
  1. We can certainly have all librariers at one place and use that as project refernce in main project. What might be missing though is some correct configuration of javalibproject. Is it working right as stand-alone?
  2. That will not be shown as other libs are shown in your mainproject.
  3. What you are trying to is also quite right though the best way to manage the jars and library dependencies is through maven/ ant+ivy.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.