Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask an encoding problem that can not set utf-8 encode #494

Open
luoshu-open opened this issue Nov 15, 2023 · 1 comment
Open

Ask an encoding problem that can not set utf-8 encode #494

luoshu-open opened this issue Nov 15, 2023 · 1 comment

Comments

@luoshu-open
Copy link

I encountered an encoding problem, I have a project with javafx and gluonfx-maven-plugin. When I run the program on jetbrain idea, or package a jar and command "java -jar xx.jar",it use utf-8 correct. But after mvn gluonfx:build and run exe on windows, it uses the incorrect encoding of gbk. How can I resolve this problem.

jdk: java17
gluonfx-maven-plugin: 1.0.21
windows 11
maven: 3.8.5

my pom

<build>
        <plugins>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <configuration>
                    <mainClass>${main.class}</mainClass>
                    <options>
                        <option>-Dfile.encoding=UTF-8</option>
                    </options>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <version>1.0.21</version>
                <configuration>
                    <target>host</target>

                    <mainClass>${main.class}</mainClass>
                    <runtimeArgs>
                        <!-- without effect -->
                        <arg>-Dfile.encoding=UTF-8</arg>
                        <runtimeArg>-Dfile.encoding=UTF-8</runtimeArg>
                    </runtimeArgs>
                    <releaseConfiguration></releaseConfiguration>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
@luoshu-open
Copy link
Author

I have also tried adding the -Dfile. encoding=UTF-8 parameter using<linkerArgs>and<nativeImageArgs>tags.<linkerArgs>has no effect, but adding<nativeImageArgs>will result in an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant