Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Java application from Sublime Text editor

Sometimes I am doing simple fixes for rather huge Java application and I don't want to open Eclipse for this task. Eclipse starts long and since the project is build out of large number of subprojects, which are build anyway by Maven, it takes ages before Eclipse is usable (at least ages in impatient Java developer scale).

Almost everything I need can be done in Sublime Text editor, however one place where Eclipse shines is debugger. My workflow is: make a fix, then test it running application (on server) using debugger, to check if everything is ok.

So is there any Sublime plugin, or other non-IDE solution for easy debugging of Java application.

Note: I have seen this post - its pretty old, maybe there is something better.

like image 872
Piotr Kochański Avatar asked Apr 19 '12 11:04

Piotr Kochański


People also ask

How do I debug in sublime text editor?

Installation of Sublime Plugin Step 3 − Start the debug session of PHP file using the shortcut Ctrl+F9. You can also do it using the Start Debug option using command palette.

Can you debug in Sublime Text?

In the menu, click on tools -> Xdebug and click on start debugging (launch browser). You will notice that your website is opened up and that ? XDEBUG_SESSION_START=sublime. xdebug is added to the end of the URL.

How do I debug a Java file?

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.


1 Answers

You could look for a standalone Java Debugger like JDebugTool.

Or you could simply create an additional Eclipse workspace with only the bare minimal you need for remote debugging your application (just one project with all the source jars linked in). This workspace will start considerably faster than the full blown.

I have never worked with a standalone debugger for Java and personally I tend to keep the number of tools I have to learn as low as possible and Eclipse's debugger is pretty good.

like image 138
allotria Avatar answered Nov 04 '22 21:11

allotria