package hello_project;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
当我跑步时: java 你好
但我使用时不起作用 javac 你好.java java 你好
类未发现错误的类名
> type Hello.java
package hello_project;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
> javac -d . Hello.java
> dir hello_project
...
Directory of C:\...\hello_project
06/14/2024 02:12 PM <DIR> .
06/14/2024 02:12 PM <DIR> ..
06/14/2024 02:12 PM 429 Hello.class
1 File(s) 429 bytes
2 Dir(s) 15,829,270,528 bytes free
> java -cp . hello_project.Hello
Hello world