Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Java code when it is out of sync?

Tags:

java

eclipse

One of the problems I'm running into is that my jar files and my source files don't match.

I'd like to:

  1. Be Notified when when source and binary don't match (I think Visual Studio can do something like this...)
  2. Set break points not by line, but by function. For example, set a break point at the entry of function foo().

I use eclipse mainly; so Solutions for eclipse would be most appreciated, but any IDE (or command line debugger) will do. Thanks!

like image 470
Grothaar Avatar asked Sep 22 '12 00:09

Grothaar


People also ask

How do you debug Java code?

A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.

How do I restart Java in debug mode?

You can restart running application by right clicking it in debug window and selecting "Terminate and relaunch".

Is running in debug mode slower?

debug code runs a lot slower than release - Visual Studio Feedback.


1 Answers

When developing just use and link to .class files that are saved by your IDE.

If your project starts to grow to a point where it's really useful to link to a .jar you're better off treating the jar's as separate projects.

like image 159
Frankie Avatar answered Oct 09 '22 19:10

Frankie