skip to Main Content

I cant run VS Code encountering this issue: "Java 11 required, but not found. Might have compilation errors."

Can somone walk me through how to fix

enter image description here

I thought I have java downloaded I dont know what to do?

2

Answers


  1. Make sure you are installing a Java 11 JDK, and not a different version, since that’s what VS Code is asking for.

    If you are on linux, there should be options to install older versions of java documented by your distribution. For example, on arch it would be sudo pacman -S jdk11-openjdk. If you are on RedHat, as indicated by your comment, it should be sudo yum install java-11-openjdk.

    On windows or mac, you should be able to find prebuilt binaries and installers online. Here is one link I found, and there are most likely others you can find online. Just make sure to select JDK 11 for whatever you use to install.

    Login or Signup to reply.
  2. Make sure that JDK 11 or above has been installed on your machine, add the following settings to indicate your JDK path

        "java.jdt.ls.java.home": "E:\Program Files\Java\jdk-17.0.5",
        "java.configuration.runtimes": [
            {
                "name": "JavaSE-1.8",
                "path": "E:\Program Files\Java\jdk1.8.0_341",
            },
            {
                "name": "JavaSE-17",
                "path": "E:\Program Files\Java\jdk-17.0.5",
                "default": true,
            }
        ],
    

    java.jdt.ls.java.home:

    Specifies the folder path to the JDK (17 or more recent) used to launch the Java Language Server. This setting will replace the Java extension’s embedded JRE to start the Java Language Server.

    You can also specify or install a new JDK in the following way

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search