我尝试在 Windows 8 的 Android Studio 上构建第一个简单的 HelloWorld 项目:
package com.samuel.helloworld;
/**
* Created by Samuel on 5/16/13.
*/
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
运行时出现异常错误:
Exception in thread "main" java.lang.ClassNotFoundException: com.samuel.helloworld.HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
进程以退出代码 1 结束
什么地方出了错?