diff --git a/docs/docs/experimental/redline.md b/docs/docs/experimental/redline.md index c43929162..74ede4c27 100644 --- a/docs/docs/experimental/redline.md +++ b/docs/docs/experimental/redline.md @@ -96,7 +96,28 @@ versions use `redline-runner-jffi-experimental`, which needs only Java 11: ``` -If both are present, the Panama runner is used wherever the JDK supports it. +The jffi runner does not bring in [jffi](https://github.com/jnr/jffi) itself, so its version can +follow the rest of your application. Add it next to the runner, together with its native +libraries: + +```xml + + com.github.jnr + jffi + ${jffi.version} + + + com.github.jnr + jffi + ${jffi.version} + native + +``` + +Without them, `builder()` fails with `NoClassDefFoundError: com/kenai/jffi/MemoryIO` instead of +falling back. + +If both runners are present, the Panama runner is used wherever the JDK supports it. Your module is then used exactly as it would be without redline: @@ -110,7 +131,8 @@ try (var instance = MyModule.builder().build()) { When native code cannot be used, `builder()` falls back to the bytecode produced by the [Build Time Compiler](../execution/build-time-compiler.md), which is always generated alongside it. -This happens on platforms outside the table above, or when no runner is on the classpath. +This happens on platforms outside the table above, or when no runner is on the classpath. A jffi +runner without jffi is an error, not a fallback. Your module keeps working either way, so the fallback is silent. To check which one you got: diff --git a/redline/it/src/it/redline-e2e/pom.xml b/redline/it/src/it/redline-e2e/pom.xml index b6b1a7a47..3932dfe0a 100644 --- a/redline/it/src/it/redline-e2e/pom.xml +++ b/redline/it/src/it/redline-e2e/pom.xml @@ -8,8 +8,19 @@ jar - + + + com.github.jnr + jffi + @jffi.version@ + + + com.github.jnr + jffi + @jffi.version@ + native + run.endive redline-runner-jffi-experimental diff --git a/redline/runner-jffi-tests/pom.xml b/redline/runner-jffi-tests/pom.xml index 3c4a56fcc..e84f52570 100644 --- a/redline/runner-jffi-tests/pom.xml +++ b/redline/runner-jffi-tests/pom.xml @@ -18,6 +18,17 @@ + + com.github.jnr + jffi + runtime + + + com.github.jnr + jffi + native + runtime + org.junit.jupiter junit-jupiter-api diff --git a/redline/runner-jffi/pom.xml b/redline/runner-jffi/pom.xml index 19da77872..17917a57c 100644 --- a/redline/runner-jffi/pom.xml +++ b/redline/runner-jffi/pom.xml @@ -14,10 +14,6 @@ Native code execution via JFFI (Java 11+) - - com.github.jnr - jffi - run.endive redline-api-experimental @@ -37,8 +33,7 @@ com.github.jnr jffi - native - runtime + provided