microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
165.02k stars 29.55k forks source link

Java code doesn't run on VS Code but runs on jGrasp #229651

Closed AGoh2019 closed 2 months ago

AGoh2019 commented 2 months ago

Type: Bug

Enter Java code using Microsoft Java JDK 21LTS Run on VS Code - encounters errors such as "Exception in thread "main" java.lang.NoSuchMethodError: void B.show(java.lang.String)" at Overload.main(Overload.java:38) But this sample of code runs perfectly in jGrasp after minor modifications. I wonder if there is something fundamentally very wrong with VS Code that professionals have not spotted.

VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)| |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)|15.77GB (6.01GB free)| |Process Argv|--crash-reporter-id b01d3d14-0623-46c9-b92e-2994ab14bca3| |Screen Reader|no| |VM|0%|
Extensions (61) Extension|Author (truncated)|Version ---|---|--- fsharp-interactive-datascience|and|1.0.12 javascript-extensions-pack---js-essentials|Bre|0.0.2 npm-intellisense|chr|1.4.5 path-intellisense|chr|2.9.0 vscode-eslint|dba|3.0.10 prettier-vscode|esb|11.0.0 fsharp-language-server-updated|fal|0.1.82 vscode-firefox-debug|fir|2.9.10 code-runner|for|0.12.2 dotnet|for|0.0.4 vscode-rust-config|fra|1.5.0 vscode-rust-extension-pack|fra|1.0.0 fsharp-language-server|geo|0.1.28 json2ts|Gre|0.0.6 javascript-essentials|Gyd|0.1.1 vscode-test-explorer|hbe|2.22.1 Ionide-FAKE|Ion|1.2.3 Ionide-fsharp|Ion|7.21.2 rust-doc-viewer|JSc|4.2.0 csharpextensions|kre|1.7.3 ts-extension-pack|loi|0.3.0 csdevkit|ms-|1.10.18 csharp|ms-|2.45.25 dotnet-interactive-vscode|ms-|1.0.5229040 vscode-dotnet-pack|ms-|1.0.13 vscode-dotnet-runtime|ms-|2.1.6 vscodeintellicode-csharp|ms-|2.1.11 debugpy|ms-|2024.10.0 python|ms-|2024.14.1 vscode-pylance|ms-|2024.9.2 jupyter|ms-|2024.8.1 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 cmake-tools|ms-|1.19.52 cpptools|ms-|1.21.6 cpptools-extension-pack|ms-|1.3.0 test-adapter-converter|ms-|0.1.9 tsimporter|pmn|2.0.1 java|red|1.34.0 LiveServer|rit|5.7.9 rust-analyzer|rus|0.3.2121 move-ts|str|1.12.0 rust-pack|Swe|0.3.38 tabnine-vscode|Tab|3.162.0 even-better-toml|tam|0.19.2 vscode-status-bar-format-toggle|tom|3.2.0 cmake|twx|0.0.17 vscode-lldb|vad|1.10.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-gradle|vsc|3.16.4 vscode-java-debug|vsc|0.58.0 vscode-java-dependency|vsc|0.24.0 vscode-java-pack|vsc|0.29.0 vscode-java-test|vsc|0.42.0 vscode-maven|vsc|0.44.0 quokka-vscode|Wal|1.0.652 JavaScriptSnippets|xab|1.8.0 rust-extension-pack|Zer|1.1.1 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 724cj586:31013169 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl2:31139839 refactort:31108082 pythonrstrctxt:31112756 flighttreat:31134774 wkspc-onlycs-t:31132770 nativeloc1:31134641 wkspc-ranged-t:31125599 cf971741:31144450 pme_test_t:31118333 fje88620:31121564 iacca2:31144504 5fd0e150:31140164 ```
roblourens commented 2 months ago

This sounds like an issue with your code or configuration, or the Java extension. You can file an issue on the Java extension repo if needed