So I have downloaded JDK 15 - OpenJDK .
Running in Intelij the following code
import jdk.incubator.foreign.MemorySegment; //The problem seems to occur here in this import
public class Application {
public static void main(String[] args){
MemorySegment m = MemorySegment.allocateNative(400L);
}
}
In inteliJ I have gone to File -> Project Structure -> Project SDK -> selected 15
In Application configurations (Intelij run project) I have declared JRE 15 (java version 15.0.2)
I receive the following error
C:Users
epositoriesjava15projectsrcmainuntitledsrcApplication.java:2:21
java: package jdk.incubator.foreign is not visible
(package jdk.incubator.foreign is declared in module jdk.incubator.foreign, which is not in the module graph)
Could someone please help me?
question from:
https://stackoverflow.com/questions/65861700/java-package-jdk-incubator-foreign-is-not-visible-error-in-java-15 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…