当我maven install在我的多模块maven项目上运行时,我总是得到以下输出:
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
Run Code Online (Sandbox Code Playgroud)
所以,我google了一下,但我能找到的是我必须添加:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Run Code Online (Sandbox Code Playgroud)
...到我的pom.xml.但它已经存在(在父母中pom.xml).
配置<encoding>maven-resources-plugin或maven-compiler-plugin也无法修复它.
所以有什么问题?
我需要在使用Java的资源属性中使用UTF-8 ResourceBundle.当我将文本直接输入属性文件时,它显示为mojibake.
我的应用在Google App Engine上运行.
谁能举个例子?我无法完成这项工作.
java google-app-engine resourcebundle utf-8 internationalization
这是我的场景构建器的样子:
这是图形用户界面:
独立的场景构建器:
我只是从 Java SDK 演示中运行以下源代码:
package sample;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Button;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
Button btn = new Button();
btn.setText("Say 'Hello World'!");
StackPane root_ctn = new StackPane();
root_ctn.getChildren().add(btn);
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
System.out.println("Hello World!");
}
});
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root_ctn, 300, 275));
primaryStage.show(); …Run Code Online (Sandbox Code Playgroud)