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\repositories\java15project\src\main\untitled\src\Application.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?