Eclipse > Java > open linked resources sources (.java instead of .class )?

前端 未结 4 2053
暗喜
暗喜 2020-12-03 22:35

I have 2 projects, A and B

project B have in his build path > libraries the class folder of A (Eclipse also recognized that there is a \"Source attachment\" and adde

4条回答
  •  心在旅途
    2020-12-03 23:07

    Another case solution:

    One neat feature of Eclipse (and other IDEs) is that you can hold CTRL and click on a function or variable to go to its definition.

    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.

    Found on this page

提交回复
热议问题