2017-08-15 45 views
0

我在Google App Engine上有一个Java服务器。最近因为这个错误我一直无法在网上部署:当部署到Google App Engine时,'Class file is Java 8,但支持最大支持Java 7'错误

IllegalArgumentException: Class file is Java 8 but max supported is Java 7 

有谁能提醒?我已经尝试了基于其他报告如下:

  • web.xml版本设置为2.5
  • 设置Eclipse的JRE到Java 7(在运行配置> JRE>执行环境:JavaSE的-1.7)
  • 添加下面以pom.xml

    <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.5.1</version> 
        <configuration> 
         <source>1.7</source> 
         <target>1.7</target> 
        </configuration> 
    </plugin> 
    

回答

1

您需要按照以下步骤更改java compiler compliance level 。 1)去​​。

2)单击属性视图中的Java Compiler视图。

3)勾选启用项目特定设置,然后选择你想要的编译器合规性级别(jdk7或jdk8)。

enter image description here