This is a quick intro to OpenJDK's Project Panama.
- Part 1 https://foojay.io/today/project-panama-for-newbies-part-1
- Part 2 https://foojay.io/today/project-panama-for-newbies-part-2
- Part 3 https://foojay.io/today/project-panama-for-newbies-part-3
- Part 4 https://foojay.io/today/project-panama-for-newbies-part-4
Part 1 is where you'll learn about jextract and Panama APIs to create C primitive type data and use the printf() function from stdio.h. https://github.com/carldea/panama4newbies/tree/main/part01
Part 2 you'll increase your knowledge on using Panama APIs to mimic C Pointers and create structs to hold complex data. https://github.com/carldea/panama4newbies/tree/main/part02
Part 3 is a chance to use Panama APIs to access third party libraries. https://github.com/carldea/panama4newbies/tree/main/part03
Part 4 is a chance to use Panama APIs to allow C code to talk to Java code. https://github.com/carldea/panama4newbies/tree/main/part04
- Make sure you know where you've downloaded the Panama Early Access Build and directory.
- Setup environment variables and run the following:
$ java -version
$ jextract -h
- Change directories to Part01 as a project you'll want to setup as the working directory.
- Run script to jextract for part 1
$ ./jextract_HelloWorld.java.sh
-
Create/Open an IntelliJ project in that directory.
-
Setup up JDK File -> Project Structure -> Project SDK Select the downloaded the early access JDK from https://jdk.java.net/panama/
-
In preferences you'll need to add --add-modules jdk.incubator.foreign.
IntelliJ you'll need to do the following:
- Ensure that directory
generated/src
is marked as generated sources root. - Setup Run configurations and JVM options