【问题标题】:'Class file is Java 8 but max supported is Java 7' error when deploying to Google App Engine [duplicate]部署到 Google App Engine 时出现“类文件是 Java 8,但最大支持的是 Java 7”错误 [重复]
【发布时间】:2017-08-15 01:15:36
【问题描述】:

我在 Google App Engine 上有一个 Java 服务器。最近因为这个错误一直无法在线部署:

 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>
    

【问题讨论】:

    标签: java eclipse maven google-app-engine


    【解决方案1】:

    您需要按照以下步骤更改java compiler compliance level

    1) 转到Project property

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

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

    【讨论】:

      猜你喜欢
      • 2017-03-21
      • 2017-08-14
      • 2017-01-10
      • 1970-01-01
      • 2014-11-27
      • 2010-11-17
      • 1970-01-01
      • 1970-01-01
      • 2013-11-18
      相关资源
      最近更新 更多