Skip to content

Unexpected 'Project xxx has no explicit encoding set' warnings #2416

Closed
eclipse-jdtls/eclipse.jdt.ls
#2061

Description

@a01fe

In a Gradle project with subprojects, each subproject directory has a " Project 'xxx' has no explicit encoding set" warning. This appears to have started with version 1.5.0 of the extension.

Environment
  • Operating System: macOS 12.3.1
  • JDK version: OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode)
  • Visual Studio Code version: Version: 1.67.0-insider Commit: a9288be67bab4e9c4dbe62207f01fafc2bdaadcb
  • Java extension version: 1.5.0
Steps To Reproduce
  1. Create basic project with Groovy DSL with gradle init
  2. Add empty subproject directory in project
  3. Add subproject directory to include in settings.gradle
  4. Open project in vscode

encoding-test.zip

Current Result

Subproject directory has "Project 'xxx' has no explicit encoding set" warning.

Expected Result

No warnings.

Additional Informations

Activity

  1. snjeza commented on Apr 15, 2022

    @snjeza
    Collaborator
  2. self-assigned this
    on Apr 15, 2022
  3. EccentricVamp commented on Apr 16, 2022

    @EccentricVamp

    The warning is appearing for me as well

    Environment

    • Operating System: Windows 10.0.19044
    • JDK: OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode)
    • Visual Studio Code: 1.66.2
    • Java extension: 1.5.0
  4. mishi321 commented on Apr 17, 2022

    @mishi321

    Similar gradle multi modules, waiting for solution.

  5. snjeza commented on Apr 18, 2022

    @snjeza
    Collaborator

    A workaround:
    You can create the <your_project>/.settings/org.eclipse.core.resources.prefs file with the following contents:

    eclipse.preferences.version=1
    encoding/<project>=utf8
    
  6. jmihalich commented on Apr 19, 2022

    @jmihalich

    Verified the above workaround fixes the issue, until we get the patch.

  7. snjeza commented on Apr 19, 2022

    @snjeza
    Collaborator
  8. a01fe commented on Apr 19, 2022

    @a01fe
    Author

    That fixes it! Thanks, @snjeza!

  9. fbricon commented on Apr 19, 2022

    @fbricon
    Collaborator

    reopening as the fix hasn't been merged yet.

  10. added this to the Early May 2022 milestone on Apr 20, 2022
  11. HaraldKorneliussen commented on Apr 25, 2022

    @HaraldKorneliussen

    The suggested workaround causes a followup problem:

    Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs

  12. snjeza commented on Apr 25, 2022

    @snjeza
    Collaborator

    The suggested workaround causes a followup problem:

    @HaraldKorneliussen could you try to clean your workspace Clean the workspace directory ?

  13. michaelmior commented on Apr 29, 2022

    @michaelmior

    @snjeza I tried the workaround and had the same problem as @HaraldKorneliussen. Cleaning the workspace directory did not solve the issue for me.

  14. snjeza commented on Apr 29, 2022

    @snjeza
    Collaborator

    @michaelmior could you attach a project sample reproducing the error?

  15. Brahvim commented on Feb 10, 2024

    @Brahvim

    Hi there. Sorry to ping for a seemingly closed issue, but this problem seems to be back for those using the default build system. ...Am I doing something wrong?:

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions