我正在尝试编写名为HelloWorld
的第一个Java程序,但我遇到了以下错误:
javac:找不到文件:HelloWorld.java
用法:javac
我的系统:Windows 10, 64bit
档案路径:C:\ProgramFiles\Java\jdk9.0.4\bin;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
我担心Java出了问题。当我在cmd中输入java
时,我会收到以下错误:
C:\ Users \ Kamil> java用法:java [options] [args ...] (执行一个类)或java [options] -jar [args ...] (执行jar文件)或java [options] -m [/] [args ...] java [options] --module [/] [args ...] (执行模块中的主类)
主类-jar,-m或--module之后的参数 /作为主类的参数传递。
其中选项包括:
-d32 Deprecated, will be removed in a future release
-d64 Deprecated, will be removed in a future release
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-p <module path> A ; separated list of directories, each directory
is a directory of modules.
--upgrade-module-path <module path>...
A ; separated list of directories, each directory
is a directory of modules that replace upgradeable
modules in the runtime image
--add-modules <module name>[,<module name>...]
root modules to resolve in addition to the initial module.
<module name> can also be ALL-DEFAULT, ALL-SYSTEM,
ALL-MODULE-PATH.
--list-modules
list observable modules and exit
-d <module name>
--describe-module <module name>
describe a module and exit
--dry-run create VM and load main class but do not execute main method.
The --dry-run option may be useful for validating the
command-line options such as the module system configuration.
--validate-modules validate all modules and exit
The --validate-modules option may be useful for finding
conflicts and other errors with modules on the module path.
-D<name>=<value>
set a system property
-verbose:[class|module|gc|jni]
enable verbose output
-version print product version to the error stream and exit
--version print product version to the output stream and exit
-showversion print product version to the error stream and continue
--show-version
print product version to the output stream and continue
--show-module-resolution
show module resolution output during startup
-? -h -help
print this help message to the error stream
--help print this help message to the output stream
-X print help on extra options to the error stream
有人可以帮助识别它的含义吗?我重新安装了它,但它仍然是一样的。
答案 0 :(得分:0)
打开cmd。 每行输入后输入:
D:
cd practice
javac HelloWorld.java