Methods to repair the ‘Java not acknowledged’ error
Listed here are the three best methods to repair Java’s “not acknowledged as an inner or exterior command” error:
- Set up or reinstall Java and the JDK in your laptop
- Add Java’s bin listing to the pc’s PATH
- Restart the command immediate, terminal window or PowerShell
If the JDK is just not put in or the PATH is misconfigured, a ‘Java not acknowledged’ error outcomes.
Is Java put in?
To run the Java command, first you have to have Java put in. This implies both the Java Runtime Atmosphere (JRE) or the total Java Improvement Package (JDK).
There are lots of methods to put in Java on Home windows or Ubuntu Linux. Listed here are two easy examples.
Set up Java on Ubuntu
To put in Java on Ubuntu, a single apt set up command is enough:
sudo apt set up default-jre Organising default-jre (2:1.11-72build2) ...
Set up Java on Home windows
To rapidly carry out a Java install on Windows, obtain the Adoptium JDK and run the .msi file, deciding on the entire default choices.

If Java is just not put in, you will be unable to repair the ‘Java not acknowledged’ error.
Add Java to the PATH
You’ll discover the Java executable file within the JDK set up’s bin listing.
If the bin listing of the JDK or JRE is just not added to the Home windows or Linux PATH variable, packages could not be capable of discover it at runtime. This would definitely trigger the “Java not acknowledged” error, even when the JDK or JRE is correctly put in.

Be certain that Java’s /bin listing is on the trail to keep away from inner or exterior command errors.
Restart the terminal window
The terminal window and the command immediate solely learn atmosphere variables once they first begin up.
If the JDK has been put in and the PATH variable set correctly, you’ll nonetheless encounter a “‘Java not acknowledged” error when you didn’t restart PowerShell or the command immediate.
Restart your terminal window, or the appliance that should discover the Java command, and take a look at once more. The “Java not acknowledged” error ought to go away for good.
Full textual content of Java error
The complete textual content of the Java not acknowledged error is as follows:
C:java-error-fix> java -version 'java' is just not acknowledged as an inner or exterior command, operable program or batch file.
When Java is put in and configured correctly, this error will go away.