Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no way to refresh the classpath after adding a library to gradle #3893

Open
zSynx94 opened this issue Dec 13, 2024 · 2 comments · May be fixed by eclipse-jdtls/eclipse.jdt.ls#3349
Open
Assignees

Comments

@zSynx94
Copy link

zSynx94 commented Dec 13, 2024

I added a new library to my java project (org.lz4:lz4-java:1.8.0) but there is no way to get them indexed again.
I tried gradlew build and gradle --refresh-dependencies but it din't work.

Environment
Operating System: Windows 10 Enterprise LTSC 21H2
Visual Studio Code version: 1.85.2
Language Support for Java(TM) by Red Hat Version: 1.37.0
JDK: Amazon Corretto jdk1.8.0_432
Gradle Version: 4.7

Steps To Reproduce
Update/add dependencies to build.gradle file
Wait for it to update (nothing will happen)

Captures
Image
Image
Image

@zSynx94 zSynx94 changed the title There is no way to refresh the classpath after adding a library to gredle There is no way to refresh the classpath after adding a library to gradle Dec 13, 2024
@snjeza
Copy link
Contributor

snjeza commented Dec 22, 2024

@zSynx94 I can't reproduce the issue. Could you attach a project example reproducing the error?

@linuxhelf
Copy link

i am having the same problem.
Neither the Task "Java: Reload Projects" nor the popup, that appears when changing the build.gradle, which wants to synchronize the classpath works for me.
Only "Java: Clean Java Language Server Workspace", which gets anoying in larger projects.

@snjeza
I have created an example project at https://github.com/linuxhelf/vscode-java-import
Steps to reproduce:

  • Open project and wait for it to build
  • see error in App.java
  • uncomment the org.json import in app/build.gradle
  • error in App.java is still present and cant be fixed by reload

What i found out while creating the example project:
This problem is only present with "java.gradle.buildServer.enabled": "off"
When using the gradle buildserver, both the popup and "Java: Reload Projects" correctly update the classpath.

@zSynx94 are you also using "java.gradle.buildServer.enabled": "off"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants