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
- Java JDK 25+
- JExtract 25+ https://jdk.java.net/jextract/
- Clang
xcode-select --installsudo apt update
sudo apt install clang# For RHEL 8 or newer/Fedora
sudo dnf install clang# Or using yum for older RHEL versions
sudo yum install llvm-toolsetsudo pacman -S clangpacman -S mingw-w64-clang-x86_64-clang- Download Jextract for your OS (https://jdk.java.net/jextract/) and unzip to a directory.
- Download JDK for your OS (https://www.azul.com/downloads/?package=jdk#zulu)
- Setup environment variables
JAVA_HOMEandJEXTRACT_HOMEand run the following:
View and modify the file setup.sh.
JEXTRACT_HOME="<path to jextract>" sh setup.shNote/Warning: The setup.sh script is for your convenience, but feel free to skip to the next section if you already installed your JDK and Jextract downloads and setup things to your liking.
Assuming things are set up you should verify with the following commands:
$ java -version
$ jextract -h - Clone this project
git clone git@github.com:carldea/panama4newbies.git
- Change directory to panama4newbies/Part01.
- Go to Part 1 and follow the steps (readme.md)
- Blog article can be found here: - Part 1 https://foojay.io/today/project-panama-for-newbies-part-1