Home > Software engineering >  Why this error occurs while trying to run java in vs code?
Why this error occurs while trying to run java in vs code?

Time:05-16

I'm trying to use vs code for java. but get this error while running the code I tried to find the solution but I couldn't find, If any solution available please refer: error

CodePudding user response:

Add the jdk path to your windows system environment.

Then in your VS code workspace settings add the path too.

CodePudding user response:

In a nutshell, you have not installed Java correctly. Finalizing the installation of Java on Windows requires some manual steps. You must always perform these steps after installing Java, including after upgrading the JDK.

  1. Find the Java path; it looks like this: C:\Program Files\Java\jdkxxxx\bin\
  2. Start-menu search for "environment variable" to open the options dialog.
  3. Examine PATH. Remove old Java paths.
  4. Add the new Java path to PATH.
  5. Edit JAVA_HOME.
  6. Close and re-open console/IDE.
  • Related