关闭。这个问题需要debugging details .它目前不接受答案。
想改进这个问题?更新问题,使其成为 on-topic对于堆栈溢出。
6年前关闭。
Improve this question
据我了解,IntelliJ 正试图从我首先创建的测试文件中运行程序。
我怎样才能解决这个问题?
我只是想运行一段简单的代码来感受一下Java。我不确定这个错误是什么意思
> Exception in thread "main" java.lang.ClassNotFoundException: Test at
> java.net.URLClassLoader.findClass(URLClassLoader.java:381) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
> java.lang.Class.forName0(Native Method) at
> java.lang.Class.forName(Class.java:264) at
> com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
这是我的代码
public class Age {
public static void main(String[] args){
System.out.println("Hey Hey");
}
}
最佳答案
右键单击然后运行 Age.main()。使用this screenshot from building and running java application
另请注意:
The public class name should be the name of the source file as well which should be appended by .java at the end. For example : The class name is . public class Employee{} Then the source file should be as Employee.java.
关于java - Java中的Hello World抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29937293/