java初学者:Could not find the main class?按书上说的编了一个:public class DisplayWindom {//main():应用程序入口public static void main(String[] args) {System.out.print("邓小平说:");System.out.println("不管白猫、黑猫,

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/15 20:32:09
java初学者:Couldnotfindthemainclass?按书上说的编了一个:publicclassDisplayWindom{//main():应用程序入口publicstaticvoidm

java初学者:Could not find the main class?按书上说的编了一个:public class DisplayWindom {//main():应用程序入口public static void main(String[] args) {System.out.print("邓小平说:");System.out.println("不管白猫、黑猫,
java初学者:Could not find the main class?
按书上说的编了一个:
public class DisplayWindom {
//main():应用程序入口
public static void main(String[] args) {
System.out.print("邓小平说:");
System.out.println("不管白猫、黑猫,能捉到老鼠的就是好猫.");
}
}
编译后执行时:
Exception in thread "main" java.lang.NoClassDefFoundError:d:/javaprogram/Displa
yWindom/class
Caused by:java.lang.ClassNotFoundException:d:.javaprogram.DisplayWindom.class
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 java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class:d:/javaprogram/DisplayWindom.class.Program will
exit.

java初学者:Could not find the main class?按书上说的编了一个:public class DisplayWindom {//main():应用程序入口public static void main(String[] args) {System.out.print("邓小平说:");System.out.println("不管白猫、黑猫,
上面的说对了一点,直接看就是找不到main();
1:上面说的,main()方法所在的类必须是主类,文件名和该main()所在类同名.
2:上面没错的话就是找不到你的.class文件.原因就是classpath和包名机制,
classpath就是JVM(虚拟机)加载类的时候所查找的路径之一,也就是自
定义class查询路径.在classpath下面找有没有你要运行的类.再一个就是
包名,在classpath下面在根据你的包名查找.如果你限定了包名的话!

java初学者:Could not find the main class?按书上说的编了一个:public class DisplayWindom {//main():应用程序入口public static void main(String[] args) {System.out.print(邓小平说:);System.out.println(不管白猫、黑猫, java.sql.SQLException:Io 异常:The Network Adapter could not establish the connection 如何解决的啊 could not could not hql查询 could not execute query错误提示:org.hibernate.exception.SQLGrammarException:could not execute queryorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExc org.hibernate.exception.SQLGrammarException:could not execute query求高手拯救,at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at could not find the required version of the Java(TM)2 Runtime Environment in '(null)'在安装64位j2ee时报的错 javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not execute query at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630) at org.hibernate.ejb.QueryIm java.sql.SQLException:IO 错误:The Network Adapter could not establish the connection启动tomcat项目出现报错,请问该怎么解决 I could not bear I could not catch could not have done could not find object could not skate at Could not find process Publishing failed Could not 谁知道could not have could not connect是什么意思