Eclipse: Project ‘PROJECT_NAME’ has no explicit encoding set

Yes, the warning for projects with no explicit default encoding is a new thing in Eclipse 2022-06 (4.24).

To set an explicit default encoding do one of the following:

  • In the Problems view, select the warning, hit Ctrl+1 and apply the provided Quick Fix (sets the project encoding explicitly to the workspace encoding)
  • Change the project manually in Project > Properties: Resource

See also my video showing and explaining this.

When using a build system like Maven or Gradle, set the encoding as follows instead:

Maven

  1. In pom.xml set the property project.build.sourceEncoding to UTF-8:
    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
  2. Right-click the project folder and choose Maven > Update Project…

Gradle

  1. In build.gradle set compileJava.options.encoding to UTF-8:
    compileJava.options.encoding = 'UTF-8'
  2. Right-click the project folder and choose Gradle > Refresh Gradel Project
  3. As long as Eclipse Buildship issue #344 is not fixed, change the encoding manually as described above

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)