"import cannot be resolved" for gradle generated code
See original GitHub issueWhen I open a gradle based project, jdtls loads successfully. However, I am seeing import errors from the server. More specifically, I see errors when importing generated code (created by gradle).
I can reproduce with an example project: https://github.com/apache/kafka
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L267-L272 will show “cannot be resolved” errors once the jdtls server starts.
The import org.apache.kafka.common.message cannot be resolved
org.apache.kafka.common.message
in this project is generated by a gradle task, and is located under
<project-root>/clients/src/generated/...
.
I see this behavior for both vscode and coc-java. is there a way to resolve this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do I get my gradle-managed Java project in eclipse to ...
When I right click my project and click gradle>refresh dependencies, the console reports a "CONFIGURE SUCCESSFUL in 0s", however the opened ...
Read more >How to generate source code during project import? - Buildship
I'm a happy command line user and use the gradle eclipse tasks frequently. Now that Buildship is 2.0 I thought it's time to...
Read more >Generated sources are not picked up anymore in a Gradle build
I have a Gradle-based project in which we generate a QueryDSL class for each class that was annotated with javax.persistence.Entity. Up till IntelliJ...
Read more >Cannot import api class from a generated openapi ... - GitHub
I've generated an artifact that I declare as a dependency, a kotlin-spring generated artifact, the dependency is resolved but I cannot import ......
Read more >Using the Gradle build system in the Eclipse IDE - Tutorial
Eclipse does not automatically update the classpath, if the build.gradle file is updated. Select Gradle Refresh Gradle Project from the context ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve got same issuse , I’ve changed
java.configuration.maven.userSettings
,its maybe some jar download failed with default maven-setting.xml cause,this’s my solution:tryCocCommand java.clean.workspace
, its work fine with meafaik there’s no JAVA_PATH env var. and this doesn’t make sense to be added to JAVA_HOME nor PATH