'Vscode debugger will not always show local variables when debugging. Stops after I halt, repeat, or try to debug again after the first time
Context: I am a student in university that learned how to use debugger a few weeks ago and primarily code in Java/Python. No frameworks yet.
Problem:
I have had a problem with my vscode bugger for quite a while and no one seems to know the answer but the gist is: my debugger won't show local variables when I debug the first time vscode is booted up. I tried all the relevant possible solutions I found and even went to my professor but even they don't know. Am I doing something wrong? How can I fix this? Please help.


Main things I tried are:
- Tried different options to run the debugger (F5, running through "Run and debug" section, etc.)
- Rebooting vscode every time I needed to debug.
- Killing terminal and debug session each time.
- Out of desperation, just printing.
I still am new to programming, so I hope its just an error on my part and that I don't need to move to a different IDE since I really like vscode.
Solution 1:[1]
I can not reproduce your problem, but you can try to clear the cache through the command of Java:clean Java Language Server Workspace in the Command Palette(shortcut of Ctrl+Shift+`). If it does not work you can try to reinstall the Debugger for Java extension, if it still does not work you can try to install the older version of Debugger for Java extension.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Steven-MSFT |
