Cannot add GraalVM modules to the project
已回答
Hi colleagues,
I am trying to make a test project with GraalVM based on jdk11. I have added the GraalVM JDK in the Idea's SDK list, selected it in the Project Structure, and wrote a simple test program. And I observe, Idea does not recognize and cannot find any classes from the org.graalvm.polyglot package. They're located in the Home/jmods/ directory as jmod files.
Although Idea compile and run my test app, all classes from these jmod modules are shown as "red" in the IDE, i. e. not found. I suppose, I have to add them somehow, please tell me how to do that.
Thank you
请先登录再写评论。
Hello - See if this answer helps.
Hi Arina,

Thank you for your reply. I suppose, it's not the reason, because I am able to build my project, and it executes normally.
Here are my settings:
And here's what I see in the editor:
The same project works fine with the 1.8 based GraalVM. The only difference I know about, is that 11 uses jmods instead of jars. Probably that's why it does not work, but I have no idea how to add them.
When I switch to the 1.8 in the "Project SDK", then "Modules" - "Module SDK" is switching automatically, and these red errors disappear. Please let me know if you have any other suggestions, I greatly appreciate any help. Thank you!
Here, I added versions:
But it works!

The issue is a known one, unfortunately.
IDEA-253219 describes it, but the request you should vote for is IDEA-171448.
I added a link to this post under IDEA-171448 so that the dev team can see your feedback.
Sorry, do I understand correctly, that registered user, who bought a product, shall VOTE to have the bug fixed?
The problem stems from the absence of a certain feature in IntelliJ IDEA, so both requests are defined as 'feature requests', not 'bugs' - hence the voting.
In a broader sense, voting on YouTrack is just a way to bring more of the developers' attention to a certain issue, be it a feature, usability problem, or a bug.
That's definitely a bug by behavior, doesn't matter need a code update (fix) or new code (impl) to resolve it.
I voted for all related issues, the question is how to workaround it for now? It's impossible to work like that.
Is it a "feature" to support Java9 and later for Idea? jmods are part of Java9+, and they're unsupported. Why it's not stated explicitly in the app description? I have GraalVM/java11 project which is impossible to work with in Idea, as Java9+ standard feature is not supported. I (and I suppose many others) wouldn't buy Idea if I knew it fully supports Java till 1.8 only
http://openjdk.java.net/jeps/261
As a workaround you can download GraalVM release for Java 8, find the jars in /jre/lib/boot and add them to PlatformSettings/SDK classpath
Sure, thank you Tatiana, this is exactly what I did in order to check what's wrong, as you could see in my original post, But the rest of my team uses Java11, and I supposed, Idea supports Java newer than 1.8
Please see IDEA-254537 for the workaround. The problem is not related to JMOD support.