-
Notifications
You must be signed in to change notification settings - Fork 34k
Description
Type: Bug
In VS Code, when I update my Java code or even comment out the entire code block, the output still shows the result from a previous run. It seems like VS Code is using a cached or outdated
.class
file instead of recompiling the latest changes.
Example:
Initial code:public class Hello { public static void main(String[] args) { System.out.println("Hello"); } }Output:
Hello
Then I updated the code:
public class Hello { public static void main(String[] args) { System.out.println("Hello"); System.out.println("Hii"); } }Expected Output:
Hello Hii
Actual Output:
Hello
Then I even tried this (commented out everything):
// public class Hello { // public static void main(String[] args) { // // No code here // } // }Still, the output was:
Hello
What I’ve Tried:
- Saved the file before running (
Ctrl+S
)- Deleted all
.class
files manually- Recompiled manually using
javac Hello.java
- Ran manually using
java Hello
- Tried in both VS Code terminal and external terminal
- Restarted VS Code
- Disabled Code Runner extension (if installed)
- Ensured file name (
Hello.java
) matches class name (Hello
)
Expected Behavior:
When I change the code or comment it out, the output should reflect the current version of the code. It should not show any output from previous versions.
Let me know if you'd like me to auto-generate the system info section based on your actual Java and VS Code setup. I can guide you through collecting that info too.
VS Code version: Code 1.102.2 (c306e94, 2025-07-22T12:15:48.520Z)
OS version: Windows_NT x64 10.0.26100
Modes:
System Info
Item | Value |
---|---|
CPUs | AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8 x 2096) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
Load (avg) | undefined |
Memory (System) | 5.88GB (0.50GB free) |
Process Argv | --crash-reporter-id be8cbcf6-6059-47bc-898b-200d2e40431c |
Screen Reader | no |
VM | 0% |
Extensions (34)
Extension | Author (truncated) | Version |
---|---|---|
jdk-setter | And | 1.0.1 |
javascript-ejs-support | Dig | 1.3.3 |
code-runner | for | 0.12.2 |
copilot | Git | 1.335.0 |
copilot-chat | Git | 0.28.0 |
vscode-pull-request-github | Git | 0.114.3 |
debugpy | ms- | 2025.11.2025072201 |
isort | ms- | 2025.1.11821009 |
python | ms- | 2025.11.2025072201 |
vscode-pylance | ms- | 2025.6.2 |
vscode-python-envs | ms- | 1.1.12031011 |
jupyter | ms- | 2025.7.2025072101 |
jupyter-keymap | ms- | 1.1.2 |
jupyter-renderers | ms- | 1.3.0 |
vscode-jupyter-cell-tags | ms- | 0.1.9 |
vscode-jupyter-slideshow | ms- | 0.1.6 |
cmake-tools | ms- | 1.21.36 |
cpptools | ms- | 1.26.3 |
cpptools-extension-pack | ms- | 1.3.1 |
live-server | ms- | 0.4.15 |
vscode-speech | ms- | 0.16.0 |
oracle-java | Ora | 24.0.0 |
java | red | 1.43.1 |
LiveServer | rit | 5.7.9 |
open-in-browser | tec | 2.0.0 |
cmake | twx | 0.0.17 |
intellicode-api-usage-examples | Vis | 0.2.9 |
vscodeintellicode | Vis | 1.3.2 |
vscode-gradle | vsc | 3.17.2025062603 |
vscode-java-debug | vsc | 0.58.2 |
vscode-java-dependency | vsc | 0.24.1 |
vscode-java-pack | vsc | 0.29.2025062500 |
vscode-java-test | vsc | 0.43.1 |
vscode-maven | vsc | 0.44.0 |
(1 theme extensions excluded)
A/B Experiments
vsliv368:30146709
binariesv615:30325510
h48ei257:31000450
nativeloc1:31344060
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
9064b325:31222308
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
c7cif404:31314491
pythonpulldiag:31343502
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
747dc170:31275177
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixf:31350060
9d2cg352:31346308
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31352135
nes-diff-11:31337487
replacestringexc:31350595
nes-set-on:31351930
6abeh943:31336334
envsdeactivate2:31353495
yijiwantestdri0626-t:31336930
0927b901:31350571
ji9b5146:31348712
0ej4-default:31346761
8gib2676:31351949
0cj2b977:31352657