Closed Jomme5 closed 6 years ago
Do you see that vscode-java extension is up an running as described on https://github.com/redhat-developer/vscode-java#troubleshooting ? What kind of a project are you using? A maven project with a pom.xml at the root?
In order for the extension to resolve your 3rd party dependencies you need to use a build tool such as maven or gradle. We use these tools to pickup your external dependencies and provide information on them without those your intellisense will be limited to single file and standard java libraries.
Funfact: I want to use VSCode to test some things out before programming it in Android Studio, with the slow Gradle-build-system. So I want to avoid complex build-systems. The external jar is already compiled with maven btw. It would be nice to use this jar in vscode with intellisense-support and use maven for building external jars once in a while. I already figured out how to compile my java-test program with the classpath-dependencies-variable. (javac -cp "/path-to-jar/*" test.java)
I understand. sorry to hear it does not fit to your expectations but Java (the language) does not come with a standard way to define dependencies (no package.json for instance) so we chose to support the most commonly used methods in Javaland for defining those.
We also support eclipse style .classpath and .project files, but I am not sure if it would help you either.
<classpathentry kind="lib" path="lib.jar" sourcepath="lib.source.jar"/>
What fixed it for me was
I reinstalled openjdk-11
If you have openjdk8 , try to upgrade or reinstall it.
Do you see that vscode-java extension is up an running as described on https://github.com/redhat-developer/vscode-java#troubleshooting ? What kind of a project are you using? A maven project with a pom.xml at the root?
https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#clean-the-workspace-directory
If the dependency is already configured in Maven, maybe cleaning the workspace and restarting Java extension is enough to solve this. At least it works for me.
If the dependency is not in Maven or Gradle, try Jomme's reply and reload workspace.
- I downloaded de "test_vs_code2.zip" from this issue
- Add "test_vs_code" project folder to Workspace via File->Add Folder.
- Copy-pasted my java test code in the main-class, altered the .classpath-file and it did what I asked.
<classpathentry kind="lib" path="lib.jar" sourcepath="lib.source.jar"/>
In order for the extension to resolve your 3rd party dependencies you need to use a build tool such as maven or gradle. We use these tools to pickup your external dependencies and provide information on them without those your intellisense will be limited to single file and standard java libraries.
Please can you explain how to do it in detail? Is there a manual somewhere btw? I Have no intellisense for 3d party libs either. I do use gradle though, I am developing a mc forge mod.
[provide a description of the issue]
Environment
What do I have to do to enable intellisense for:
Intellisense or codecompletion/sugestions doesn't work at all.