gpt4 book ai didi

java - 我的 GWT 项目的 java.io 和 java.nio 需要继承什么模块?

转载 作者:行者123 更新时间:2023-12-01 11:48:17 24 4
gpt4 key购买 nike

我正在尝试遵循这个例子:

Charset utf8 = StandardCharsets.UTF_8;
List<String> lines = Arrays.asList("1st line", "2nd line");
try {
Files.write(Paths.get("file5-test.txt"), lines, utf8);
} catch (IOException e) {
e.printStackTrace();
}

我已经导入了所需的模块:

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

但是编译时出现以下错误:

[ERROR] Errors in 'file:/C:/Users/Glyndwr/workspace/AwardTracker_N/src/org/AwardTracker/client/PackSummaryView.java'
[ERROR] Line 309: No source code is available for type java.nio.charset.Charset; did you forget to inherit a required module?
[ERROR] Line 309: No source code is available for type java.nio.charset.StandardCharsets; did you forget to inherit a required module?
[ERROR] Line 313: No source code is available for type java.nio.file.Files; did you forget to inherit a required module?
[ERROR] Line 313: No source code is available for type java.nio.file.Paths; did you forget to inherit a required module?

我想我需要添加到我的 AwardTracker.gwt.xml:

<inherits name="module name/>"

但是,我找不到要继承的正确模块名称。
另外,我需要导入一个jar吗?

我们将非常感谢您的帮助。

问候,格林

最佳答案

这看起来像是服务器端代码,不应成为 GWT 客户端的一部分。

关于java - 我的 GWT 项目的 java.io 和 java.nio 需要继承什么模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28976419/

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