redhat-developer / redhat-developer/vscode-java

jdk incubator module cannot be resolved

Open
#1,148 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

JPMS
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".

Screen Shot 2019-11-15 at 4 46 48 PM
Environment
Steps To Reproduce

In general, create a project use jdk incubator module should see this

Be more specific to this,

  1. Obtain a build for project panama foreign-abi branch
  2. 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>
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.