Debug Java in Brackets editor or Visual Studio Code

2.8k views Asked by At

I really hate the IDE. They are too heavyweight and add a bunch of IDE specific files and folders and whatnot when creating a project. For the sake of making things easier, I use code editors. My favorite are Brackets and Microsoft's cross platform Visual Studio Code. My only issue is that no matter how hard I try, I cannot find a way to compile or debug Java in these editors. When I make a search for "debug java in (editor name here), I get a bunch of results for debugging JavaScript, not Java.

Does anyone on stack know how to do this?

2

There are 2 answers

1
JShell On BEST ANSWER

You can compile Java using the command line, by navigating to the correct directory and using the javac command. I'm afraid you're probably out of luck when it comes to debuggers. The best you can do, to my knowledge, is to use prints to track your code.

0
Greymarch On

Found the following extension which allows you to debug and run java from VSC:

https://marketplace.visualstudio.com/items?itemName=donjayamanne.javadebugger

Not having much luck with it. Getting a bunch of debug-symbol errors, due to my dependencies and classes being in separate files. I think if you kept your code in one main code file, it could work nicely.