0
我刪除了較早的類和.ear
文件,清理了工作空間,用JavaSE 1.6編譯了代碼,將系統庫設置爲1.6,然後編譯並創建了.ear
。當虛擬機有另一個比編譯的類文件的版本(較小的版本)發生J2EE:[.class文件中的版本號不正確]
WebApp E [Servlet Error]-[Bad version number in .class file]: java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:577)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:529)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:403)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionClassLoader._loadClass(JSPExtensionClassLoader.java:103)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionClassLoader.loadClass(JSPExtensionClassLoader.java:70)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionClassLoader.loadClass(JSPExtensionClassLoader.java:52)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
感謝您的回覆,它真的幫助 – Shailesh