redhat-developer / redhat-developer/vscode-java
jdk incubator module cannot be resolved
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
Trying to use OpenJDK project Panama's new incubator module for native memory/function access, VSCode shows "The import jdk.incubator cannot be resolved".
Environment
- Operating System: MacOS
- JDK version: Local build of Project Panama (https://openjdk.java.net/projects/panama/)
- Visual Studio Code version: 1.40.1
- Java extension version: 0.53.1
Steps To Reproduce
In general, create a project use jdk incubator module should see this
Be more specific to this,
- Obtain a build for project panama foreign-abi branch
- Set up maven toolchain
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>14</version>
<vendor>panama.mem</vendor>
</provides>
<configuration>
<jdkHome>path to the build here</jdkHome>
</configuration>
</toolchain>
</toolchains>
- Open attached sample project
attach a sample project sample.zip
Current Result
maven build works fine, but VSCode shows "The import jdk.incubator cannot be resolved" on import lines and code using API from the module are shown as cannot be resolved.
Expected Result
Package and APIs are resolved
Additional Informations
It would be helpful be able to tweak javac options like --add-modules, --add-exports in workspace setting for simple projects like testing.
Set java.home just is not enough.
In order for this project to build with VSCode, I am forced to create maven project so that I can add this compiler options.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the attached sample.zip and its Maven toolchain setup; reproduce the unresolved jdk.incubator imports in VSCode using the listed Project Panama JDK. Compare the Maven build's module handling with the extension's workspace behavior, then verify that the package and APIs resolve and that --add-modules/--add-exports can be supplied for simple projects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100