NOTICE: when you run a java class, do not use "java Hello.class", instead, use "java Hello". Because "." is expained as package separater. How is a java class called? first the jvm search the classpath, then the codebase, just like when running a program in dos it search the path. then, it add the package to the classpath or codebase and invoke the class. for example: current classpath set to d:\java, and the command-line like "java examples.test.TestJava", the package sentence in your TestJava.java should be: package examples.test; and there should be a dir structure like this: d:\java\examples\testand your TestJava.java and TestJava.class should be in this dir.
楼上那位请说清楚一点好吗,我今天才开始学java啊,
不要让我受到打击
我输入 java hello
得到和你一样的错误若输入 java Hello
就正确了,好奇怪哦!!!lhcyf 你也初学java吗?
共同进步吧,[email protected],
java 是区分大小写的,一定要注意啊.
How is a java class called? first the jvm search the classpath, then the codebase, just like when running a program in dos it search the path. then, it add the package to the classpath or codebase and invoke the class. for example:
current classpath set to d:\java, and the command-line like "java examples.test.TestJava", the package sentence in your TestJava.java should be:
package examples.test;
and there should be a dir structure like this:
d:\java\examples\testand your TestJava.java and TestJava.class should be in this dir.
http://www.jcreator.com/
免费的
谢谢指教
to:other
谢谢今天是我第二天学习java,我要多多努力,愿多向大家学习。
注意大小写,敏感的