microsoft / vscode

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

Java program doesn't run. Need to use debug #140549

Closed AGoh2019 closed 2 years ago

AGoh2019 commented 2 years ago

We have written the needed data into your clipboard because it was too large to send. Please paste.

Issue Type: Bug

The following program does not run when I use "Run code". It only executes when I choose the "Debug" option.

import java.util.Scanner;

public class TypeCasting { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { System.out.print("Enter a number: "); int num1 = sc.nextInt(); System.out.println("Entered value is: " + num1); float f1 = num1; System.out.print("Entered value as a floating point variable is: " + f1); } }

VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:40:02.816Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.77GB (8.21GB free)| |Process Argv|--crash-reporter-id 6a9b48c2-3fcc-4f70-ba92-f92d3c88b672| |Screen Reader|no| |VM|0%|
Extensions (78) Extension|Author (truncated)|Version ---|---|--- easy-cpp-projects|ACh|2.0.0 typescript|Ais|0.0.1 include-autocomplete|ajs|0.0.4 cucumberautocomplete|ale|2.15.1 code-gnu-global|aus|0.2.2 vscode-django|bat|1.8.0 calva|bet|2.0.233 ruby-debug|cas|0.3.5 solargraph|cas|0.23.0 path-intellisense|chr|2.6.0 vscode-ruby-test-adapter|con|0.9.0 erb|Cra|0.0.1 doxdocgen|csc|1.3.2 c-cpp-compile-run|dan|1.0.15 c-cpp-project-generator|dan|1.2.4 vscode-eslint|dba|2.2.2 vscode-dash|dee|2.4.0 python-environment-manager|don|1.0.3 python-extension-pack|don|1.7.0 vscode-generate-getter-setter|DSK|0.5.0 gitlens|eam|11.7.0 prettier-vscode|esb|9.1.0 code-runner|for|0.11.6 kotlin|fwc|0.2.23 json2ts|Gre|0.0.6 ruby|gro|0.1.0 CppSnippets|har|0.0.15 vscode-test-explorer|hbe|2.21.1 ruby-starter|Hoo|0.0.2 ruby-linter|hoo|1.0.0 rails-snippets|Hri|1.0.8 better-cpp-syntax|jef|1.15.10 vscode-rufo|jnb|0.0.4 vsc-python-indent|Kev|1.14.2 kite|kit|0.147.0 ccpp-extension-pack|Leo|1.1.0 ts-extension-pack|loi|0.3.0 ruby-runner|Mat|0.1.1 Kotlin|mat|1.7.1 vscode-rufo|mbe|0.2.1 ruby-symbols|mig|0.1.8 ruby-rubocop|mis|0.8.6 HTMLHint|mka|0.10.0 python|ms-|2021.12.1559732655 remote-containers|ms-|0.209.6 remote-ssh|ms-|0.70.0 remote-wsl|ms-|0.63.13 cmake-tools|ms-|1.9.2 cpptools|ms-|1.7.1 cpptools-extension-pack|ms-|1.1.0 test-adapter-converter|ms-|0.1.5 vscode-typescript-next|ms-|4.6.20220111 gradle-language|nac|0.2.3 autodocstring|njp|0.5.4 tsimporter|pmn|2.0.1 typescript-hero|rbb|3.0.0 ruby|reb|0.28.1 java|red|1.2.0 partial-diff|ryu|1.4.3 kotlin-on-vscode|set|0.0.1 trailing-spaces|sha|0.3.1 code-spell-checker|str|2.1.3 move-ts|str|1.12.0 tabnine-vscode|Tab|3.5.15 python|tht|0.2.3 cmake|twx|0.0.17 vscode-lldb|vad|1.6.10 haml|vay|1.0.1 vscodeintellicode|Vis|1.2.15 simple-ruby-erb|vor|0.2.1 vscode-java-debug|vsc|0.37.0 vscode-java-dependency|vsc|0.18.9 vscode-java-pack|vsc|0.20.0 vscode-java-test|vsc|0.33.1 vscode-maven|vsc|0.34.2 Ruby-extension-pack|wal|1.0.0 jinja|who|0.0.8 vscode-ruby|win|0.28.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30283811 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 vscop804cf:30404767 vscop940:30404999 vsrem710cf:30416617 vsccppwtstudy:30421978 ```
weinand commented 2 years ago

/extJava