During the framing process, a problem was encountered: Javax.servlet.ApplicationContext unsupported Major.minor version 51.0.
Workaround:
Will depend on the following
<dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> < Version>7.0</version></dependency>
Switch
<dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> < Version>6.0</version></dependency>
Principle:
Different JDK versions use different Major.minor version numbers, which can cause this error. Javase 8 = (0x34 hex), javase 7 = Wuyi (0x33 hex), javase 6 = (0x32 hex), javase 5 = (0x31 hex), j2se 1.4 = (0x30 he x), J2SE 1.3 = (0x2F hex), J2SE 1.2 = (0x2e hex), J2SE 1.1 = (0x2D hex) in the project to compile and run Java programs in the JDK (JRE) version to be consistent, generally in the high version (such as JD K7) The compiled class runs in a lower version of the JVM (such as JRE6), and the error above will appear.
Ask:
Green don't copy, mine's all 1.6.
Chase Answer:
Pro, except for those version numbers, the others I did not copy. Do you have a look at the third-party libraries you're using, or have they been compiled before JDK6?
Ask:
Thank you very much!!! I'm running an example of a crawler4j crawler, prompting edu/uci/ics/crawler4j/crawler/crawlconfig:unsupported Major.minor version 51.0 refers to some packages such as crawler4j. But how do you see what versions of these are compiled?
Chase Answer:
Unzip the jar and take a look at the meta-inf/manifest. MF, there will be this information in it.
Like the jar of Jsoup I'm looking for:
650) this.width=650; "class=" ikqb_img "src=" http://h.hiphotos.baidu.com/zhidao/wh%3D600%2C800/sign= 38094697be99a9013b6053302da52643/80cb39dbb6fd5266f72fa697ad18972bd4073628.jpg "style=" border:0px; "alt=" 80cb39dbb6fd5266f72fa697ad18972bd4073628 "/>
You can see that this version of the built JDK version is 1.8.0_25 (JDK8).
Ask:
Manifest-version:1.0archiver-version:plexus Archivercreated-by:apache mavenbuilt-by:yaganjisbuild-jdk:1.7.0_13
Chase Answer:
Obviously, your build-jdk is 1.7.0_13, but your operating environment is JDK6 (lower than the compilation environment, pay attention to my comments, I said a wrong place, and then comment on the changes). So you should choose an earlier version of crawler4j or upgrade your JDK to
Java error: Unsupported Major.minor version 51.0