F3 opens the classB.class file instead of the classB.java file [message #1007927] |
Fri, 08 February 2013 03:54  |
Eclipse User |
|
|
|
I have 2 projects A & B,project A is a library project. B is a normal app project. B references A.
When I open a java file classB in project B, and click F3 on classA in the source of classB, where classA is a class in project A, eclipse opens classA.class in the new tab which contains the source lines including the comments line but it's readonly. I have to manually open classA.java for editing. This is verify annoying. It is never a problem in other IDEs.
I hope Eclipse open the classA.java directly in the editor.
|
|
|
|
|
Re: F3 opens the classB.class file instead of the classB.java file [message #1039790 is a reply to message #1010036] |
Fri, 12 April 2013 11:41   |
Eclipse User |
|
|
|
I am alwas annoyed by this behavior.
I tried to put the projectA.jar at the very top of Order and Exports in project B, but when I press F3 or, worse, when I click on a stack trace in the console, it still opens the .class file.
It just doesn't make sense to me that Eclipse can identify the proper .java source file using the source attachment, can tell the source is in my workspace, can see that the relevant project A is currently open, but still doesn't think I might need to edit it.
I can avoid this by adding project A in project B's project dependencies (java build path, tab 'Projects'). But when I do that, all .class files of project A appear in project B's 'classes' folder and duplicate the classes in projectA.jar.
[Updated on: Fri, 12 April 2013 11:48] by Moderator
|
|
|
|
Re: F3 opens the classB.class file instead of the classB.java file [message #1041585 is a reply to message #1040248] |
Mon, 15 April 2013 05:23  |
Eclipse User |
|
|
|
Hello, thanks for looking into my problem.
The output folder is defined in the Java Build Path, tab 'Source' as MyProject/WebRoot/WEB-INF/classes. Note that it is a web project. And it is MyEclipse.
I checked and it is not in this output folder that the .class files of ProjectA appear, but in the deployment folder under tomcat. This happens when ProjectA is in 'Java Build Path > Project'. Is there a way to avoid this?
Just to be sure, when you say I must define a dependency on the project, should I define the dependency under 'Project Dependency' or under 'Java Build Path > Projects'?
And if I should not define a dependency on the jar, how can I tell ProjectB which jar in ProjectA to use?
[Updated on: Mon, 15 April 2013 05:23] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.07279 seconds