Gradle Encoding Problem

Hey Guys. I try to output a simple println(“äöü”) in Java. But i only get these Symbols “���” or Questionmarks. I execute my Gradle Project with the Gradle plugin “application”. First of all i thought its an Source Encoding or Compile Encoding Problem. But if i change the Encoding with compileJava.options.encoding = ‘example’, I get different Errors, which means the Command works.

I also tried:


The command looks like doenst work:

compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'

I will ad my Test Project here, so you can comprehend my Problem. GitHub - sebaX94/Test

I use:
VisualStudio Code, Eclipse IDE
Java 18.0.2
Gradle 7.4.2, Gradle 8.0 milestone2

Run through a debugger and verify whether the String is what you expect.
If you see those question marks on the command line, you are most probable actually outputing the correct characters, but not in the encoding your command line interpreter is.
If you for example output UTF-8 and your console is not configured to use UTF-8.
That is then not a Gradle problem at all.

Okay. So i changed the cmd codepage with chcp 65001 to UTF8, executed the Project via cmd and still get these Symbols. What have I done wrong?

Edit: I installed IntelliJ and created a Project. For now it works. I dont know what I have done wrong by creating a Gradle Project with Eclipse. So Thread is solved and can be closed.