将 java 升级到 openJDK11 后编译 GWT 时面临问题

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

升级 java 后出现以下异常。我在我们的项目中使用 gwt 2.9 库和 ant。即使在添加像 ant.jar colt-1.2.0.jar asm-7.1.jar jsinterop-annotations-2.8.2-v20191108.jar base-1.0.0 这样的依赖 jar 之后-beta-2.jar tapestry-util-text-4.0.2.jar

 [java] Compiling module hashcode
     [java]    Resolving com.google.gwt.core.client.AsyncProvider
     [java]       Found type 'com.google.gwt.core.client.AsyncProvider'
     [java]          [ERROR] Unable to find class java/lang/Object
     [java]          [ERROR] Unable to find class java/lang/Object
     [java]          [ERROR] Unable to find class java/lang/Object
     [java]          Resolving method get
gwt
1个回答
0
投票

应该有更多的错误,而不仅仅是这个小片段,但这可能是最好的提示:

gwt 2.9

jsinterop-annotations-2.8.2-v20191108.jar

GWT 2.9 不再提供自己的 jsinterop-annotations 副本,但您应该使用 jsinterop-annotations 2.0.0。来自 https://www.gwtproject.org/release-notes.html#Release_Notes_2_9_0:

能够编译jsinterop-base 1.0.0、elemental2 1.0.0、jsinterop-annotations 2.0.0的项目。除了@JsAsync 和@JsEnum 之外,这使得 GWT2 在这些工具中与 J2CL 兼容。

查看您的 jsinterop-annotations 副本的版本并检查 maven central 中具有该名称的 jar 列表,看起来您可能正在使用

org.realityforge.com.google.jsinterop:jsinterop-annotations:2.8.2-v20191108
。相反,请切换到
com.google.jsinterop:jsinterop-annotations:2.0.0
.

如果您使用的是 GWT SDK zip 下载,jsinterop-annotations 已经打包在 gwt-user.jar 中,因此您无需自带。

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