I have two java projects in eclipse. Second one is using first one's jar. When I try to navigate to first one's class from second one, it opens .class
of that file. But I want to open the first one project file. Please help.
Thanks in advance.
I have two java projects in eclipse. Second one is using first one's jar. When I try to navigate to first one's class from second one, it opens .class
of that file. But I want to open the first one project file. Please help.
Thanks in advance.
If you want to link your second project with your first project, don't add the first project in form of a JAR file to the second.
Instead open the project properties of the second project and select "Java Build Path". On the right side on the "Projects" tab you can add your first project as "required project on the build path".
The class files of project 1 are now added to the class path of project 2. And if you click on a class name you directly get to the source code.
Ideally, the JAR of the first project would appear under the "Referenced Libraries" of the second project. Right-click on that JAR, and choose Properties -> Java Source Attachment. Provide a variable that links to the source files of this JAR.
Alternatively, install a decompiler plugin (see jd-eclipse) which will decompile class files when you navigate them in Eclipse, so that you can see the source.