Compiling and running the java and Maven application with the same encoding

Asked

Viewed 101 times

0

I have an application I am compiling using Maven from the command line. In my pom.xml I specified the encoding using:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

And when I run the application I use the following command:

"C:\Program Files\Java\jdk1.8.0_171\bin\java" -Dfile.encoding=UTF-8 -jar myJar.jar

However, when I run the application at the prompt appear strange characters... like:

ADVERTÊNCIA ou INFORMAÇÕES

  • Is using which ide?

  • I use the eclipse, but I am compiling and running at the prompt.

  • Then try to change the file encoding directly by eclipse. Go to Window > Preferences > General > Content Types. There you can change all. java or any other extension to UTF-8.

  • It’s already like UTF-8

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.