views:

95

answers:

1

I'm remotely debugging a Java application in Eclipse. (Bunch of Alfresco projects with attached sources in ZIP-files.)

Breakpoints do work, but:

1) Whenever I set a breakpoint in *.class file Eclipse opens *.java file when the breakpoint is reached.

2) When I set the breakpoint from within the *.java file a new breakpoint is created (apparently independent on the one set in *.class), and in the breakpoints list it does not offer 'Go to file' option.

3) The bullet indicating a breakpoint is never displayed in the *.java file; Regardless of whether the breakpoint has been created from within *.class or *.java file.

(If it wasn't for 2 and 3 I would happily stick with *.java files, of course.)

Am I doing something wrong? ...or is this usual behaviour and there's nothing I can do about it?

+1  A: 

Check your "Order and Export" in the "Java Build Path" preference of your project.
(or in the 'Classpath' tab' of your Run Configuration Launcher)

For a local project, if the output directory ('build' or 'bin' or 'cls' or ...) appears before the 'src' of what you are debugging, you will experience that kind of "breakpoint" mix-up.

For a remote project, if the jar has the sources attached to them, it should work.

VonC
The 'build' folder is not listed in the Order and Export tab at all. I'm thinking the keyword here is 'remote' (debugging), i.e. no code of my own is involved, yet.
Jaroslav Záruba
For example LoginBean.class is linked from alfresco-web-client-3.3g.jar in Referenced Libraries, this JAR has attached source in ZIP. Even when I move this JAR to the very first place in the Order and Export it does not make a difference.
Jaroslav Záruba
@Jaroslav: not sure, but can you try adding the sources directly as a "library", and put that before the `alfresco-web-client-3.3g.jar` (which would keep the same zip as attached sources)
VonC
/src added to 'Libraries', moved to the first place in 'Order and Export', Eclipse still opens LoginBean.java :(
Jaroslav Záruba
@Jaroslav: "still opens LoginBean.java": oops, that was my intention actually: does a breakpoint works in that Java file?
VonC
kinda yes, except that 1) in the file the breakpoint bullet (on the left) is not displayed, 2) double-click on the breakpoint in the breakpoints list does nothing and 3) i can't quick-find the file via Ctrl+Shift+T nor +R
Jaroslav Záruba
@Jaroslav: darn... I hoped it would have improved the situation at least a little. Still looking.
VonC
thanks for your efforts anyways VonC :)
Jaroslav Záruba