java is not an internal command of cmd.exe.
As this command is without file extension and without full path, Windows searches first in current directory C:lazedssampledb
for java.*
to find either java.com
, java.exe
, java.bat
, java.cmd
and some other file extensions.
The file extensions are defined in environment variable PATHEXT separated by semicolons which can be viewed in a command prompt window with command set PATHEXT
If there is no such file with file name java
in current directory, Windows searches in all directories specified separated by semicolons in environment variable PATH. Entering just path
or set path
in a command prompt window results in a display of those directories. (set path
lists the directories of PATH and the file extensions of PATHEXT as both environment variables start with the string "path".)
The environment variable JAVA_HOME is needed perhaps by the Java package itself and other applications, but is definitely not read by Windows to find an executable file with name java.
Search for the directory containing java.exe and append the directory of this file to PATH. On command line this can be done with:
PATH=%PATH%;Full path to directory containing java
Do not enter double quotes even if the full path to directory containing java.exe contains 1 or more space characters.
Or you run the java application with the command line
"Full path to directoryjava.exe" -cp hsqldb.jar org.hsqldb.Server
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…