Issue
I downgraded from Windows 11 to Windows 10 today and had to reinstall the Eclipse-IDE.
After successfully importing my workspaces and fixing the projects, a warning appeared for every project saying "Project XXX has no explicit encoding set". I've already searched for a solution and only got some fixes for VSCode.
I had Eclipse 2021-6 and installed Eclipse 2022-6
Solution
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
- In
pom.xml
set the propertyproject.build.sourceEncoding
toUTF-8
:<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> - Right-click the project folder and choose Maven > Update Project...
Gradle
- In
build.gradle
setcompileJava.options.encoding
toUTF-8
:compileJava.options.encoding = 'UTF-8'
- Right-click the project folder and choose Gradle > Refresh Gradel Project
- As long as Eclipse Buildship issue #344 is not fixed, change the encoding manually as described above
Answered By - howlger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.