[Solved] “Java is not recognised as an internal or external command” in vs code even though I am trying to use kotlin. I properly set the path also


This error occurs because you have not installed the Java JDK.

How to use Kotlin in VS code

First you need to install the following programs on your machine

  • Install Java JDK on the computer system
  • Install Kotlin on your computer system
  • VS code install plugin Kotlin Language
  • VS code install plugin Code Runner

installation steps:

  1. Please install Java JDK according to this document

    enter image description here

    After the installation is complete, you can run the java -version command in the cmd window to check whether the installation is successful

    enter image description here

  2. Download the kotlin compiler here

    enter image description here

    After unzipping, add the bin folder path to the system environment variables

    enter image description here

    After the installation is complete, you can run the kotlinc -version command in the cmd window to check whether the installation is successful

    enter image description here

  3. Install plugins in VS code: Kotlin Language and Code Runner

It is now possible to use Kotlin in VS code.

Use the play button in the upper right corner or right-click to select Run Code to run the code

enter image description here

If you want the result to be output in the TERMINAL panel, please add the following configuration in settings.json

    "code-runner.runInTerminal": true,

enter image description here

0

solved “Java is not recognised as an internal or external command” in vs code even though I am trying to use kotlin. I properly set the path also