作业帮 > 综合 > 作业

could not find the main class.profram will exit 异常

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/18 21:18:27
could not find the main class.profram will exit 异常
导入的包
import java.io.FileInputStream;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFCell;
出现的异常
java.lang.UnsupportedClassVersionError:Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
请告诉帮我分析一下问题的所在,中间程序应该没有问题吧,我不知道是java版本错啦吗,我用的是1.5的jdk
could not find the main class.profram will exit 异常
编译和执行的JDK版本不一致 为了能在JDK版本为1.5机子上也能运行,就对myEclipse进行如下修改:Project->Properties->Java Compiler->Configure Workspace Setting,在弹出的页面中进行设置,将JDK由6.0改为5.0,然后就可以正常运行了.