Search code examples
javaeclipsepackagemyeclipse

In MyEclipse - package prefix missing in all package imports in code


I just offered to work on this project from someone else, and have not had any experience with MyEclipse (and minimal with Eclipse itself). When looking through the package structure all the packages are named like this:

java.com.example1
java.com.test

The import and package statements in the code are like this:

package com.example1

import com.test

Which is giving me package not found errors, what can I do to fix this? I feel this is something really obvious here that I'm not getting


Solution

  • Sam,

    Right click the project in Eclipse and open Properties and select "Java Build Path" from the left side. On the right hand side you will see a Tab "Source". Remove the existing source folders and re-add them by clicking "Add Folder" and select check box for "Java" in the tree. You are telling eclipse to consider all the folders under this "Java" as your packages\files.

    Not sure if i explained properly but do reply back and i will see if i can attach a screenshot. Good luck.

    -Reds