O
O
Ozzishe2022-02-03 00:51:36
Java
Ozzishe, 2022-02-03 00:51:36

How to run Java code in VSCODE Windows?

Hello everyone, I’ll say right away that I’m a complete zero in your area, I found Schildt’s book on Java, for the sake of interest I read, I write even, it seems to be interesting. Until the moment with the problem (which I will indicate below), everything was fine. I set up vscode, downloaded all the java extensions, in general the code compiled, everything was fine (it was on Windows 7). A week later, I installed Windows 10 somewhere, downloaded vscode, jdk, installed the necessary extensions, but there was a problem: the code that I have left in my computer now does not start, and the new one does not work, there are no errors (well, or I don’t see them ), the debugger starts and nothing happens. I honestly tried to google, found something about PATH and so on, reinstalled extensions, jdk, nothing helps. Please advise, thanks in advance.

launch
61fafbe9a33e6967829810.png
There is also such a plate
61fafc2b64ad5635923424.png
debugger
61fafc61dcfa1698934781.png


UPD: Now I checked how it works in python. Everything is fine there, but for some reason it shows as if I'm running? from E: /Jawa (yes, I know Java is correct). Could this be somehow related? Screenshot below.
?
61fafe6862f48734529644.png


PS I understand that VSCode for java is not the best choice, but everything worked before.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2022-02-03
@Ozzishe

Good afternoon.
Well, the first thing that catches your eye is your source code (which, by the way, should be framed by the code tag, and not be added as a screenshot, according to the rules of the site). It is convenient to write code in Java using Intellij IDEA Community Edition or Eclipse.
Try to do without VSCode to start with and compile the project using the console.
Using the command, cdchange to the directory that contains the java file.
Then compile it into bytecode javac GuessTheGame.java
Then try to run your code through the command java GuessTheGame
If there are problems, then enter:
java -version
and post the result here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question