部署GAE时,我收到"IllegalArgumentException:类文件为Java 8,但最大支持的Java 7",但是我到处都在使用Java 7 [英] When deploying GAE I get "IllegalArgumentException: Class file is Java 8 but max supported is Java 7", but I'm using Java 7 everywhere

查看:31
本文介绍了部署GAE时,我收到"IllegalArgumentException:类文件为Java 8,但最大支持的Java 7",但是我到处都在使用Java 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试借助Eclipse Luna 4.4部署Google App Engine项目,但是每当我转到部署到App Engine"时,都会收到以下错误消息:

I'm trying to deploy a Google App Engine project with the help of Eclipse Luna 4.4, but whenever I go to "Deploy to App Engine" I get the following error message:

------------部署前端------------

------------ Deploying frontend ------------

准备部署:在以下位置创建了登台目录:'C:\ Users \ [[USERNAME]]〜1 \ AppData \ Local \ Temp \ appcfg6715651699721496450.tmp'java.lang.IllegalArgumentException:类文件是Java 8,但最大支持Java 7:C:\ Users \ [[USERNAME]] \ ..HEALTHAPP \ Api \ war \ WEB-INF \ classes \ com \ example \ mycompany \ myapplication \ api \ buses \ BusEventSingleton.class

Preparing to deploy: Created staging directory at: 'C:\Users\ [[USERNAME]]~1\AppData\Local\Temp\appcfg6715651699721496450.tmp' java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: C:\Users\ [[USERNAME]]\ ..HEALTH APP\Api\war\WEB-INF\classes\com\example\mycompany\myapplication\api\buses\BusEventSingleton.class

调试信息可以在C:\ Users \ [[USERNAME]] \ AppData \ Local \ Temp \ appengine-deploy4610763336673097422.log中找到

Debugging information may be found in C:\Users\ [[USERNAME]]\AppData\Local\Temp\appengine-deploy4610763336673097422.log

但是在项目中,右键单击->属性,我可以看到Java编译器级别是1.7:

But in Project right click -> Properties I can see how the Java Compiler level is 1.7:

以及Project Facets如何还将Java版本建立为1.7:

and how the Project Facets also establishes Java version as 1.7:

所以有人知道我为什么收到此消息吗?Java 8正在编译什么,我该如何更改?

So anyone knows why I get this message? What is being compiled with Java 8 and how can I change it?

推荐答案

更改JDK符合性已为我解决了此问题.
您可以转到Java编译器页面,更改编译器的遵从级别,如以下步骤所示.

Changing the JDK compliance fixed the issue for me.
You can change the compiler compliance level by going to the Java Compiler page as shown in the steps below.

  1. 在项目资源管理器"视图中,右键单击该项目,然后选择属性.
  2. 在属性"中选择"Java编译器"页面窗口.
  3. 在"JDK遵从性"部分中,选择所需的编译器合规水平.(JDK 7)
  4. 单击应用",然后单击确定".请参见

这篇关于部署GAE时,我收到"IllegalArgumentException:类文件为Java 8,但最大支持的Java 7",但是我到处都在使用Java 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆