Unsupported major.minor version 52.0 這類錯誤是因為Java版本不一致造成的,在高版本的JDK(1.8)環境中編譯JAR包,然后JAR在低版本的JVM(1.6)中運行。
jdk版本和stanford parser對應關系
- J2SE 8 = 52
- J2SE 7 = 51
- J2SE 6.0 = 50
- J2SE 5.0 = 49
- JDK 1.4 = 48
- JDK 1.3 = 47
- JDK 1.2 = 46
- JDK 1.1 = 45
最簡單方式還是對 Eclipse 的項目屬性的設置(項目右鍵 -> properties -> Java Compiler, 設置"Compeler compliance settings"為1.6)
參看:
https://blog.csdn.net/skylin19840101/article/details/52212074