Skip to content

Gradle project no detected as Java Project #2162

Closed

Description

@icruces

I have created a simple Spring Boot gradle project using Spring Initializr extension. The problem is that it is not recognised as a Java Project in VS Code.

I can make it detect it by configuring the src/main/java folder as a source folder but still, it doesn't import the gradle dependencies.

Environment
  • Operating System: Windows 10
  • JDK version: 11
  • Visual Studio Code version: 1.61.0
  • Java extension version: 0.82.0

Project:
demo.zip

Activity

  1. fbricon commented on Oct 12, 2021

    @fbricon
    Collaborator

    Works for me.
    Please enable the "java.trace.server": "verbose" setting, restart vscode and attach the 2 extension logs (Command palette : Java: Open all log files) here, so we can troubleshoot the issue.

  2. icruces commented on Oct 12, 2021

    @icruces
    Author

    Thanks, find attached the logs.
    logs.zip

    I have other Gradle projects working fine with VS Code, the main difference is that they were created with Eclipse.

  3. fbricon commented on Oct 12, 2021

    @fbricon
    Collaborator

    The logs are incomplete. The best is probably to start from scratch:

    • Command palette : Java: Clean Java Language Server Workspace
    • Command palette : Java: Open all log files
    • Copy both log files (client AND server)
  4. icruces commented on Oct 12, 2021

    @icruces
    Author

    Lets see now:
    logs.zip

  5. fbricon commented on Oct 12, 2021

    @fbricon
    Collaborator

    you disabled gradle support in your settings. Please set "java.import.gradle.enabled":"true" in your settings.json

  6. icruces commented on Oct 12, 2021

    @icruces
    Author

    Brilliant, that was it. Don´t know why I had that set to true.
    Many thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions