I'm not an advocate for using Eclipse or any of it's relatives (IBM RAD). But on some projects, I can't avoid having to use it because the project only works on in Eclipse.
As often as I can, I will try to use IntelliJ because of its superior user interface. But when the code can't run from IntelliJ, I've set up a quick tutorial to setting up cross IDE debugging.
In Eclipse:
Right click on the code to run to get context menu --> Run as --> Run
In "Run" Dialog, create new or choose existing profile --> Arguments --> VM Arguments = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 --> Run
The application will now start and wait for the debugger. The console will say "Listening for transport dt_socket at address:5005"
In IntelliJ:
Menu Item "Run" --> "Edit Configurations" to open the "Run/Debug Configurations" dialog
Add new configuration (+ button) --> Remote --> Choose name for configuration --> ok
Enter appropriate breakpoints and start the debugger with the configuration and the console will say "Connected to the target VM, address: 'localhost:5005', transport:' 'socket'.
IntelliJ debugging bliss.
thanks mate, this helped me out :)
ReplyDeleteI was wondering how in the world do I tell intelliJ's debugger to connect to a VM, now I found it.