简体   繁体   English

VSCode Java Project:类文件的版本为55.0,应为52.0,Gradle Build Failing

[英]VSCode Java Project: Class file has wrong version 55.0, should be 52.0, Gradle Build Failing

I have a Java project in VSCode that is failing to build via Gradle and WPILib (FRC code). 我在VSCode中有一个Java项目,该项目无法通过Gradle和WPILib(FRC代码)构建。

This is a screenshot of my terminal while trying to build. 这是我尝试构建终端时的屏幕截图。 I've seen replies that say it's a problem with the JAVA_PATH variable, but that can't be it because this code is failing to build on multiple devices. 我已经看到有答复说这是JAVA_PATH变量的问题,但是那不可能是因为此代码无法在多个设备上构建。 It seems to be a problem with the software itself, has anyone had this problem before or have suggestions about how to fix it? 这似乎是软件本身的问题,是否有人以前曾遇到过此问题,或者对如何修复有任何建议? I've checked my vendor libraries, all of them are up to date (the only one relevant here is REV Robotics, and that's the correct version. 我已经检查了我的供应商库,所有库都是最新的(这里唯一相关的是REV Robotics,这是正确的版本。

This errors say, that the classes inside SparkMax-java-1.0.27.jar were compiled with a newer Java compiler (Java 11) and your Gradle Build compiles with a Java 8 compiler. 该错误表示,SparkMax-java-1.0.27.jar中的类是使用较新的Java编译器(Java 11)编译的,而Gradle Build是使用Java 8编译器编译的。 You have to set your Gradle build to compile with Java 11. 您必须将Gradle构建设置为可与Java 11一起编译。

Should be build.gradle 应该是build.gradle

apply plugin: 'java'
sourceCompatibility = 11
targetCompatibility = 11

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 class文件版本55.0错误,应该是52.0 - Class file has wrong version 55.0, should be 52.0 类文件有错误的版本 55.0,应该是 52.0 (IntelliJ) - Class file has wrong version 55.0, should be 52.0 (IntelliJ) Xamarin.Android 错误:class 文件版本错误 55.0,应该是 52.0 - Xamarin.Android Error: class file has wrong version 55.0, should be 52.0 构建 Alfresco 时出现错误“类文件的版本 55.0 错误,应为 52.0” - error "class file has wrong version 55.0, should be 52.0" when building Alfresco java: class 文件版本错误 61.0,应该是 55.0 - java: class file has wrong version 61.0, should be 55.0 UnsupportedClassVersionError: 已由较新版本的 Java Runtime(类文件版本 55.0)编译,此版本 (..) 高达 52.0 - UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0 Class 文件版本错误 52.0,应该是 50.0 - Class file has wrong version 52.0, should be 50.0 编译javaFX项目时“类文件的版本错误为54.0,应该是52.0” - "class file has wrong version 54.0, should be 52.0" while compiling javaFX project 无法编译Java代码-“类文件的版本错误为52.0,应为48.0” - Cannot compile Java code - “class file has wrong version 52.0, should be 48.0” 谷歌云平台中的“类文件版本错误 55.0,应为 53.0” - 'class file has wrong version 55.0, should be 53.0' in Google Cloud platform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM