Java – multiple projects using eclipse
I have a workspace in eclipse with two projects
I want to reference project #2 in project #1, but when I go to project – > properties – > reference and check the project I want to add as a reference, I still can't instantiate the class of project #2 in project #1
This is a BlackBerry application developed with Java and eclipse
PROJECT1 Launcher. java
Item 2 screen java
I want to use screen SCR = new screen()// In project1
Solution
You need to add the project to the build path so that the eclipse java compiler can see other projects
>Select project – > properties – > java build path – > Project tab > select Add... > Add "project 1" and OK to return to the workspace
There is one more thing to check If your classes are in the default package, they will not be imported If so, try moving the class to an explicit package
For example:
import mypackage.Screen; ... Screen scr = new Screen();