As shown in the command results below, JAVA_HOME is correctly configured as an environment variable and PATH to bin is correctly configured, but entering javac-version
displays the error message.
I tried various things such as restarting Windows and reinstalling Java 14, but it didn't work, so I'm having a hard time.Thank you very much.
Microsoft Windows [Version 10.0.18362.720]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\>set JAVA_HOME
JAVA_HOME=C:\Program Files\Java\jdk-14
C:\>Path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk-14\bin;C:\Users\Muroya Ichirakura\Locoa;Windows\Locoa;Apps\Locals\App
C:\>javac-version
'javac-version' is an internal command or an external command.
Not recognized as an operational program or batch file.
There is no half-width space between javac
and -version
, which is causing an error.
Run with half-width spaces.
Enter javac
and javac.exe
at the command line and "C:\Program Files\Java\jdk-14\bin\javac.exe"
mean the same thing.
When you enter javac
at a command prompt, the command prompt looks for javac (.exe)
by looking at the environment variable PATH
from the beginning.
(It's more complicated, but I'll skip it if I check the current directory or include .bat.)
Found by entering javac
, javac.exe
determines the action by reading the command-line arguments separated by spaces.
Pass the *.java
file to the argument to compile it, or pass the -version
option to return the version information.
The above sequence of flows is the internal processing when you set PATH
to bin and enter javac-version
.
Inserting spaces at first may not work because of one of the following reasons:
PATH
because I set PATH
from the advanced system settings after launching the command promptPATH
so it works
684 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
526 Uncaught (inpromise) Error on Electron: An object could not be cloned
546 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.