How to Know Java Is Installed or Not?

Open Command Prompt or Terminal

Type `java -version`

Press Enter

If Java is installed, version details will appear

If Java is not installed, an error message will appear

Type `javac -version`

Press Enter

If the Java compiler is installed, its version will appear

If `javac` is not recognized, the JDK is not installed or not in PATH

On Windows, type `where java`

On macOS or Linux, type `which java`

If a path is returned, Java is installed

If no path is returned, Java is not installed or not in PATH

Suggested for You

Trending Today