java关于helloword的一个问题
Helloworld.java文件代码如下publicclassHelloWorld{publicstaticvoidmain(String[]args){System....
Helloworld.java文件代码如下
public class HelloWorld{
public static void main(String[] args){
System.out.println("HellowWorld");
}
}
在cmd终端运行了以下命令
javac Hellowold.java
java Helloworld后出现下列错误
Exception in thread "main" java.lang.NoClassDefFoundError: Helloworld (wrong name: HelloWorld)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
想知道代码中到底是哪里出现了问题 展开
public class HelloWorld{
public static void main(String[] args){
System.out.println("HellowWorld");
}
}
在cmd终端运行了以下命令
javac Hellowold.java
java Helloworld后出现下列错误
Exception in thread "main" java.lang.NoClassDefFoundError: Helloworld (wrong name: HelloWorld)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
想知道代码中到底是哪里出现了问题 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询