-2

I made sure that I installed jdk on my computer. I entered java -version on my computer, but it showed that jdk was not installed. I want to know what went wrong.

Charlie
  • 9
  • 1
  • 2
    Most likely `java` is not on your system path, meaning that while Java is installed, it is not visible in the location you are typing `java -version`. – Tim Biegeleisen Jun 28 '21 at 03:24
  • If you're on mac or linux, try "which java" to see if there are any recognized installations. And can you clarify "I made sure". What evidence has your computer given you that gave you full assurance? – Mukherjee Jun 28 '21 at 03:26
  • See here for instructions on how to add Java to your operating system path. It works in windows 10: [How to set java\_home on Windows 7?](https://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7) Other operating systems will have a slightly different way to do it, but a quick search online will give you what you need. – sorifiend Jun 28 '21 at 03:46

1 Answers1

5

First, right-click on the "Properties" option of "This computer" on the computer desktop. Second, select the environment variable option. Third, Fill in "Java_Home" in the "Name", The value is the JDK installation path.

Wen xu Li
  • 1,698
  • 1
  • 4
  • 7