Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.06 KB

File metadata and controls

61 lines (41 loc) · 2.06 KB

CedarJava

This package provides the Java interface for the Cedar language. You can use these to call Cedar from your Java applications. See java-hello-world for an example of calling Cedar from a Java application.

For more information about Cedar, please see: https://www.cedarpolicy.com/

Prerequisites

Building

Run the Gradle Wrapper with the build task to compile both the Cedar Java Foreign Function Interface and the Cedar Java library.

./gradlew build

Our build is quite long (due to the cross compiling), so to just check syntax:

./gradlew check -x test

Debugging

Debugging calls across the JNI boundary is a bit tricky (as ever a bit more so on a Mac), but can be done by attaching both a Java and native debugger (such as GDB/LLDB) to the program.

Windows Support

Windows is not officially supported, but you can build CedarJava manually for Windows targets using the following workaround:

  1. Clone the repository:

    git clone https://github.com/cedar-policy/cedar-java
    cd cedar-java/CedarJavaFFI
  2. Build the native library for your target ABI:

    # For GNU ABI (MinGW)
    cargo build --features partial-eval --release --target x86_64-pc-windows-gnu
    
    # For MSVC ABI (Visual Studio)
    cargo build --features partial-eval --release --target x86_64-pc-windows-msvc
  3. Set the CEDAR_JAVA_FFI_LIB environment variable to point to the generated DLL.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.