The resource is not on the build path of a java project eclipse

Solution 1:

1. Window > Preferences > Java > Installed JREs
2. Select the JRE you use and click 'Edit...' button on right.
3. In 'Edit JRE' popup, click 'Directory...' button and select <JDK_HOME>/jre (note you don't select just JDK_HOME directory)
4. Click OK and click Finish and finally Ok button
5. If it doesn't automatically build your project, do it manually by 'Clean...' to make sure
Now try it again, open the class, click the name and press F3.


Solution 2:

 open the Properties of the Project and select the
Java Build Path section; then examine the Source tab to determine if one
of those locations includes the file.

If there is no .java file or the .java file is misplaced in src folder of the project, it will show "source file is missing"

create src folder inside project and place the .java file in that folder and clean the project.

Comments

Popular Posts