适用于 Java 8 的 Google 闭包编译器

问题描述 投票:0回答:2

哪个 Google 闭包编译器版本适用于 java 8?

尝试过v20220905版本:

java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
java-8 google-closure-compiler
2个回答
0
投票

根据docs版本v20220502是针对Java8编译的最后一个版本。 (下一个版本需要java 11)

<dependency>
    <groupId>com.google.javascript</groupId>
    <artifactId>closure-compiler</artifactId>
    <version>v20220502</version>
</dependency>

-1
投票

您没有提供太多信息。无论如何,问题与您使用的 JDK 版本有关。

55 中所需的 Java 版本 - 即 Java 11(或更高) 您的 JDK 版本是 52 - 即 Java 8

您应该升级 JDK(或使用支持 Java 8 的此库版本)。

有关 Java 文件版本的更多信息:https://en.wikipedia.org/wiki/Java_class_file#General_layout

© www.soinside.com 2019 - 2024. All rights reserved.