hediet / vscode-debug-visualizer

An extension for VS Code that visualizes data during debugging.
https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer
GNU General Public License v3.0
7.87k stars 410 forks source link

Step by Step Instructions For Java #27

Closed HeIp closed 1 year ago

HeIp commented 4 years ago

Don't know how to get this up and running with a java project

hediet commented 4 years ago

Can you provide more details? Were you able to debug your project in VS Code?

HeIp commented 4 years ago

I actually only installed your plugin, ran debug image

hediet commented 4 years ago

You can find a java demo project here.

HeIp commented 4 years ago

Not sure How to use the debugger / demo to get it to work. Sorry noob here.

hediet commented 4 years ago

You just open the demo project in VS Code, go the debug pane and select java: image

HeIp commented 4 years ago

But to use it on a new non related project ? What would I have to do to get this to wok

hediet commented 4 years ago

Well, first you need to be able to debug your program in VS Code. See here for help. Only then my extension can be helpful.

HeIp commented 4 years ago

image I don't get the selection you do for Run & Debug This is more or less what im working with

hediet commented 4 years ago

Ah, you need to open the demo folder in vscode, not the project root folder! Then you get different debug targets.

HeIp commented 4 years ago

Got the Demo to pop up , Debug Visualizer is empty however image

HeIp commented 4 years ago

Can you upload a step by step instruction ? or Gif with full process @hediet

hediet commented 4 years ago

I'm working on it!

HeIp commented 4 years ago

Thank you!

briscola commented 4 years ago

@HeIp it can be slightly challenging to get the java demo to work, but I was able to get it to work. What i did was, I created a new maven / java project in Eclipse, using the spring boot blank project template. I only did so because I know that springboot includes the necessary jars as used by the demo codes. Then I copied all the files from the demo/java directory over, then I fixed the package names of those files as per what I've created in Eclipse, and check that this project builds. Then I closed eclipse, and opened that directory as created by Eclipse in Visual Studio Code. Do ensure that the Microsoft Java Extension Pack extension is installed.

Then I ensure that I have these in the launch.json. And I ran that debug task as stated below, and it works as per the screenshot.

{ "version": "0.2.0", "configurations": [ { "type": "java", "name": "Debug App<app>", "request": "launch", "mainClass": "company.app.App", "projectName": "app" }, ] }

Thank you @hediet for making this extension, it's really useful. I can't wait to see this continue to get better and better..

hediet commented 4 years ago

@briscola thanks! Though it shouldn't be that hard to get the Java demo running. I'll investigate that! Simply installing the Java SDK, the Java vscode extension and pressing F5 after opening the Java demo should be enough.

HeIp commented 4 years ago

Can anyone make a Tutorial Video for the Java one :) , no dice on my side

erlansan commented 4 years ago

Hello @hediet , i'm trying the same thing with java and your VS extension. I have 2 goals in mind:

  1. I need to find out how to run your debugger with java in VS Code. At the time i'm getting weird output when trying to debug with Debugger View open. It shows the value of the variable. If i'm doing something wrong, i would appreciate it if you could show me the right direction. image

  2. I want to add your VS extension into Eclipse Che IDE. I've already managed to add it to my browser IDE, but it's not showing anything so far. If i could get at least VSC to run with java, maybe i could try the same in my browser IDE.

hediet commented 4 years ago

I will improve the documentation in the next few months, but currently I'm very busy.

Your Java expressions must evaluate to JSON that can be visualized. See the readme for the format of that json!

I will also see whether I can make it running in Eclipse Theia.

erlansan commented 4 years ago

@hediet thanks for the response. I would appreciate if you could update the link to demo projects, because current link is broken.

hediet commented 4 years ago

Hey, sorry for the delay. You can find one java demo project here: https://github.com/hediet/vscode-debug-visualizer/tree/master/demos/java

Another here: https://github.com/hediet/vscode-debug-visualizer/pull/33/commits/3330fc3af8c42da9e9dc381966c3e4ceac11296c

queakie24 commented 7 months ago

Hi, I'm trying to figure out how to run the extension using Java, and whenever I open the debugger and change the top-left part to the "JavaScript Debug Terminal" option or the "Node.js" option, both say "Shell integration failed to activate" in the box to the right of the terminal. I'm not even getting the window that others are getting that says "No Expression" in the center.

I tried going to the Java demo that you linked as well, but I can't seem to find a download button on that page. Wondering if there has been a change and that the Java compatability is using other files now? And where does the "Debug Visualizer : New Viewer" command go?