gpt4 book ai didi

java - 将 GWT 2.5 网络应用程序迁移到 Java 10

转载 作者:搜寻专家 更新时间:2023-10-31 19:59:32 28 4
gpt4 key购买 nike

我有一个使用 GWT-2.5.1 和 Java 8 构建的大量网络应用程序。随着 Java 8 的弃用,我需要将其迁移到 Java 10/11。

我已经设法解决了一些问题,但我遇到了一个我无法解决的问题。

构建应用程序时,出现以下错误:

[INFO] Compiling module com.<xxx>
[INFO] [ERROR] Unable to find type 'java.lang.Object'
[INFO] [ERROR] Hint: Check that your module inherits
'com.google.gwt.core.Core' either directly or indirectly (most often by
inheriting module 'com.google.gwt.user.User')

查看 gwt.xml 文件,我认为它是正确的:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="xxxx">
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.user.theme.clean.Clean" />
<inherits name="com.google.gwt.logging.Logging" />
<inherits name="com.XXXXCoreBase" />
<!-- Delete non-0inherits stuyff -->
</module>

<!-- XXXXCoreBase -->
<?xml version="1.0" encoding="UTF-8"?>
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.query.Query"/>
<!-- Other module inherits -->
<inherits name="com.google.gwt.gen2.gen2" />
<inherits name="com.Microsoft" />
<inherits name="org.Org" />

<source path="client" />
<source path="shared" />

</module>

使用 Java 8 编译非常顺利。我需要做什么来解决这个问题?

最佳答案

根据 Release_Notes_2_8_2

Supports running in Java 9. Note that this does not yet mean that GWT can compile Java 9 sources, or support the Java 9 JRE changes, but that a Java 9 JRE can be used to compile a GWT project. Do note that the new --module-path flag is not supported, but -classpath must still be used as in the past.

discussion here -

If you aren't using java 9 modules, the latest release will work. It does this by reading the classpath from System.getProperty("java.class.path"), so if you are using standard tools for creating classpath, everything should work fine. If you are doing anything non-standard for assigning classpaths, or if you are using java 9 modules (i.e. you supply a modulepath instead of classpath), this will very likely not work for you.

似乎,您最多只能升级到 gwt-2.8.2,但仅限于使用类路径而不是制作您的应用程序模块化。

此外,这里是对 Java10 support discussion. 的进一步阅读

关于java - 将 GWT 2.5 网络应用程序迁移到 Java 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51877006/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com