Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that java is not an internal or external command, nor is it a runnable program?

Shulou Source: shulou.com Published: 2022-05-31 19:35:54 09月11日 Update

This article mainly explains "java is not an internal or external command, nor is it how to solve the error problem of runnable programs." interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn that "java is not an internal or external command, nor is it how to solve the error reporting problem of runnable programs."

Brief introduction

I encountered this problem when learning to use the command line of Java to compile java files.

Windows operating system reported an error

"javac' is not an internal or external command, nor is it a runnable program or batch file." here's how to solve it.

Friends who can't find environment variables and user variables in the comment area.

Post blindly

Solution process

According to the inquiry, it is not installed here (or after it is installed but not set up on the environment variables).

Step 1: download the corresponding JDK on the website (just use JDK)

Click the circle in the image above (if there is an updated version, the operation should be similar)

Install boldly, in fact, this installation is very fast. (during installation, I directly chose the default address (of course, the corresponding address is also possible).

My JAVA file is located at C:\ Program Files\ Java (you can reinstall it if you don't remember)

After installation, you need to configure the environment variables, as follows

In the user variable, add a new variable, named java_home, at C:\ Program Files\ Java\ jdk-10.0.2, and notice the address of my previous JAVA file.

Add a variable to Path. The addresses are C:\ Program Files\ Java\ jdk-10.0.2\ bin

There may still be problems.

After doing the above, it may not work. Here are two solutions.

First, restart cmd

Second, in Path, adjust the location of the two bin folders (move up to the top), then restart cmd

From the second method above, you can see that, in fact, the javac exe file is in this bin folder (that is, the one in jdk).

The effect after the solution

As follows

At this point, I believe you have a deeper understanding of "java is not an internal or external command, nor how to solve the error problem of runnable programs." you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Variable file address command problem program run method environment two content location folder time user website face install learn configure Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Tech Info Huawei Microsoft Shulou Information