Eclipse, open declaration that is defined in a library

后端 未结 2 406
生来不讨喜
生来不讨喜 2021-02-09 01:13

In Eclipse if I press F3 or open declaration on a reference that is in one of my libraries, it opens a read only copy of the code.

I thought this quite useful at first a

相关标签:
2条回答
  • 2021-02-09 01:43

    You need to attach correct source when you ctrl+click or press F3 to any class which is in the library. Just click on attach source -> external folder -> attach the src folder of the library you are using. Eclipse will itself find out the correct .java file.

    I had the same issue with Action interface in struts 2.0. So i attached the src folder inside my struts directory and bobs your uncle.

    0 讨论(0)
  • 2021-02-09 01:56

    If you have the dependent library open as a Java project within Eclipse, you can add the project to the build path. ( Right click on project -> properties -> java build path -> Projects -> Add).

    Under the Order and Export section, make sure the project is above the library.

    After doing this when you press F3, the .java file will open.

    0 讨论(0)
提交回复
热议问题