简体   繁体   中英

Debugging single Java class in Spring Tools Suite

I have been a JavaScript developer for a while, and have started picking up Java. I have installed the STS IDE, as I intend to develop applications in Spring Boot. Not to mention, the learning curve is too steep here compared to VS Code or WebStorm. There is literally no literature available online on how I can debug a single Java class on this IDE. I am expecting to set some breakpoints and step through on a standalone Java file.

My short answer for this would be:

  • create a new, plain Java project
  • create a new class (with a main method)
  • edit the java source of that newly created class
  • set a breakpoint somewhere
  • hit "Debug as..." from the context menu

and you end up in the debugger, where you can step through, look into the stack frames, inspect the values of variables and objects, execute random things in the debug shell, and a lot more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM