Q:

Understanding Eclipses' "The resource is not on the build path of a Java project" error message?

In eclipse I often will get this error:

For example, I tried to use the shortcut to change a method signature: Alt + Shift + C but it gives me that error.
Is this because I may be using a different project? Thank You Very Much

A:

Refactoring operations, like many other java-specific operations, rely on the ability of the tooling to correctly parse the code in question.  Generally, that means that:

The code has to be valid enough (syntax and grammar) for the selected element to the correctly parsed.
The java source file in question needs to be within a java project's source folder.
The build path must be correct and error free so that referenced classes and packages can be correctly identified.

This message is telling you that one or more of those conditions are not met.

