A problem which may occur in Eclipse is that it opens the
.class
file (the compiled file) instead of opening the .java
file when you do this. This is probably caused by the order of the entries in the .classpath
file.Go to your project directory and open the .classpath file. Move all entires of type
classpathentry
with attribute kind="src"
to the top of the file (or at least above any entries with kind "output").Restart Eclipse and the problem should be fixed.