2011-05-05 39 views
2

我有一個ear應用程序,其中包含兩個EJB和一個使用編譯器遵從性1.5的WEB(war)項目。在我的Web項目中,我創建了一個實用程序Class文件,它接受xml文件的字節數組,並使用vtd-xml庫v2.10返回一些字符串值,並在servlet中實例化此類的對象。在對象的構造函數(即取一個字節數組)的調用我得到的錯誤:在Java中使用vtd-xml拋出java.lang.UnsupportedClassVersionError

java.lang.UnsupportedClassVersionError: Bad version number in .class file 

當我從類中刪除所有VTD-XML相關的對象我沒有得到這個錯誤。任何意見,將不勝感激。

問候

回答

2

你可以重新編譯使用的build.bat文件(包含vtd-xml.zip),以獲得新的VTD-XML。罐。

2

documentation說:

Thrown when the Java Virtual Machine attempts to read a class file and determines that the major and minor version numbers in the file are not supported.

您正在使用的庫必須編譯時有不同版本的Java。

3

這聽起來像VTD-XML的jar文件中有類,是1.6

2

現在它可以執行build.bat文件(包含在vtd-xml.zip中),但是您需要將目標版本編輯爲1.5而不是1.6

相關問題