Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to debug Tomcat Java application from Visual Studio Code

I am relatively new to Java but need to do some changes to Java code. I prefer using Visual Studio Code for this. The Java code builds to .WAR file using Maven and is deployed to Tomcat.

Is there any way to debug this app directly from Visual Studio Code?

like image 599
Sergey Kandaurov Avatar asked Jun 19 '17 10:06

Sergey Kandaurov


People also ask

Can you debug Java in VS Code?

Visual Studio Code allows you to debug Java applications through the Debugger for Java extension. It's a lightweight Java debugger based on Java Debug Server, which extends the Language Support for Java™ by Red Hat. Here's a list of supported debugging features: Launch/Attach.

How do I add Java debugger to Visual Studio Code?

In Visual Studio Code, open the Extensions view (Ctrl+Shift+X). Type "java" to filter the list. Find and install the Extension Pack for Java or standalone Debugger for Java extension if you already have Language Support for Java™ by Red Hat installed.


1 Answers

Visual Studio Code has a lot of tools to do this in marketplace.

For Tomcat you can use this: https://marketplace.visualstudio.com/items?itemName=adashen.vscode-tomcat

You can do all this things:

  • Add Tomcat Server from Tomcat Install Path
  • Start/Restart Tomcat Server from VSCode
  • Run war package on Tomcat Server
  • Debug war package on Tomcat Server
  • Run exploded war on Tomcat Server
  • Debug exploded war on Tomcat Server
  • Open server homepage in browser to check all deployed war packages
  • View all deployed war packages in Tomcat Explorer
  • Open war package homepage in browser
  • Stop Tomcat Server
  • Rename Tomcat Server
  • Customize JVM Options when starting Tomcat Server
  • Reveal deployed war packages in file explorer
  • Delete deployed war package

You need the debugger posted by Mert Mertce tho.

like image 114
gonzaloan Avatar answered Oct 10 '22 23:10

gonzaloan