'Maven dependency : Failed to get sources. Instead, stub sources have been generated by the disassembler
when i'm navigating to a maven dependency class, i get a .class file with this comment on top and no doc is shown :
// Failed to get sources. Instead, stub sources have been generated by the disassembler.
// Implementation of methods is unavailable.
I don't have the issue with Java classes, only maven dependencies.
I have enabled download sources in the maven settings.xml and in the java extension pack settings.
Anyone has any idea how to solve this please ?
Solution 1:[1]
Could you try to set the "java.jdt.ls.java.home"
manually? Set it to the JDK you installed on your computer.
Some people others had run across this kind of problem. It looks like an issue with the language server's embedded JRE.
Solution 2:[2]
i had the same problem and i solve it,try this:
- set settings.json in vscode, "java.eclipse.downloadSources": true,"java.maven.downloadSources": true
- add follow settings in settings.xml of maven:
<settings>
<!-- ... other settings omitted ... -->
<profiles>
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>
</settings>
3.reopen vscode and it will download javadoc
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Steven-MSFT |
Solution 2 | Knight990 |