Skip to content

carldea/panama4newbies

Repository files navigation

Panama 4 Newbies

This is a quick intro to OpenJDK's Project Panama.

Part 1 - Learning Java Panama and C primitive types

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 - Learning Java Panama and C Pointers and Structs

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 - Learning Java Panama and C based Third Party Libraries

Part 3 is a chance to use Panama APIs to access third party libraries. https://github.com/carldea/panama4newbies/tree/main/part03

Part 4 - Learning Java Panama and C based Callbacks (Function Pointers)

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

Setting up your IDE

  1. Make sure you know where you've downloaded the Panama Early Access Build and directory.
  2. Setup environment variables and run the following:
$ java -version
$ jextract -h 
  1. Change directories to Part01 as a project you'll want to setup as the working directory.
  2. Run script to jextract for part 1
$ ./jextract_HelloWorld.java.sh
  1. Create/Open an IntelliJ project in that directory.

  2. Setup up JDK File -> Project Structure -> Project SDK Select the downloaded the early access JDK from https://jdk.java.net/panama/

    Panama Builds

  3. In preferences you'll need to add --add-modules jdk.incubator.foreign.

IntelliJ you'll need to do the following:

Add modules

  1. Ensure that directory generated/src is marked as generated sources root.
  2. Setup Run configurations and JVM options

Add JVM Options

About

This is a blog series to explore OpenJDK's Project Panama.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published