Last week, during the Java practical session, some students had trouble entering user input while running their code in VS Code. This happens because Code Runner (the extension used to run code) runs programs in the Output window, which does not support interactive input by default.
Here’s how to fix it:
- go to file menu --> preferences --> Settings
- Search for code runner in the search bar
- Scroll down and tick the checkbox for “Run in Terminal”
That’s it! Now your Java program will run in the terminal, and you’ll be able to enter input without any issues.
Top comments (2)
tnx
You are welcome