在 JDK 1.0 到 1.8 版中设置 java 类路径:-cp vs -classpath?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17157074/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Setting the java classpath: -cp vs -classpath in JDK versions 1.0 through 1.8?
提问by Daniel
I've been looking at compiling and running Java programs from the command line and I keep seeing different versions of setting the classpath: -cpvs -classpath. I want to think these are identical but can someone more knowledgeable than me confirm or refute this?
我一直在研究从命令行编译和运行 Java 程序,我一直看到设置类路径的不同版本:-cpvs -classpath。我想认为这些是相同的,但比我更有见识的人能否证实或反驳这一点?
采纳答案by Pshemo
回答by austin
They are the same. Do java -help
to see all the options. -cp and -classpath
do the same thing.
他们是一样的。执行java -help
以查看所有选项。-cp and -classpath
做同样的事。