From 44830eb9f6d89973708ff1acbf1e88d08491508e Mon Sep 17 00:00:00 2001 From: Dave Lester <18080+davelester@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:55:14 -0700 Subject: [PATCH 1/2] Update README.md Restructures README to improve clarity, and makes some adjustments to language. --- README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index de039e8..23d3931 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ # Swift Java JNI Core -## Swift Java Interoperability - -Swift offers Java interoperability using the [SwiftJava](https://github.com/swiftlang/swift-java) package, package plugins, and also the `swift-java` command line tool for source generation (similar to OpenJDK jextract, if you are familiar with that concept). +The swift-java-jni-core package presents a *low-level* Swift-friendly interface to the Java Native Interface (JNI) specification, which is the universal set of data types and functions for interacting with a Java Virtual Machine and compatible derivatives, such as the Android Runtime (ART). You can view it as a thin layer on top of the `jni.h` along with pre-packaged type conversions and ways to interact with the JVM from Swift. -Most developers should prever the use of that package, as it features bullet proof ways to make your inter-op code safe and performant, by using either source generation (`swift-java`) when calling Swift from Java, or Swift macros (`@JavaMethod`, ...) when calling Java from Swift. Multiple safeguards and optimizations are built into the SwiftJava library and we highly recommend using it instead of this low level "raw JNI" package. +This package is designed to offer low-level zero-dependency support for higher-level modules, such as [SwiftJava](https://github.com/swiftlang/swift-java) and other projects. -## Swift Java JNI Core +## Swift Java Interoperability -The swift-java-jni-core package presents a *low-level* Swift-friendly interface to the Java Native Interface (JNI) specification, which is the universal set of data types and functions for interacting with a Java Virtual Machine and compatible derivatives, such as the Android Runtime (ART). You can view it as a thin layer on top of the `jni.h` along with pre-packaged type conversions and ways to interact with the JVM from Swift. +Swift offers Java interoperability using the [SwiftJava](https://github.com/swiftlang/swift-java) package, package plugins, and also the `swift-java` command line tool for source generation (similar to OpenJDK jextract, if you are familiar with that concept). -This package is designed to offer low-level zero-dependency support for higher-level modules, such as [SwiftJava](https://github.com/swiftlang/swift-java) and other projects. +Most developers would benefit from using the SwiftJava package, as it features robust ways to make your interop code safe and performant, by using either source generation (`swift-java`) when calling Swift from Java, or Swift macros (`@JavaMethod`, ...) when calling Java from Swift. Multiple safeguards and optimizations are built into the SwiftJava library and we highly recommend using it instead of this low level "raw JNI" package. -## Features +## Swift Java JNI Core Features ### JavaValue @@ -29,4 +27,3 @@ This C module provides the standardized and implementation-agnostic headers for ## Contributing Contributions are more than welcome, and you can read more about the process in [CONTRIBUTING.md](CONTRIBUTING.md). - From 3612f01056e4384a95651347a06432ea6c21baef Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Fri, 27 Mar 2026 11:23:00 +0900 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Konrad `ktoso` Malawski --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 23d3931..872d8c0 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ The swift-java-jni-core package presents a *low-level* Swift-friendly interface This package is designed to offer low-level zero-dependency support for higher-level modules, such as [SwiftJava](https://github.com/swiftlang/swift-java) and other projects. +> Most developers should prefer to use the [SwiftJava](https://github.com/swiftlang/swift-java) package for language interoperability. The `swift-java-jni-core` package exists solely for sharing low-level infrastructure. + ## Swift Java Interoperability Swift offers Java interoperability using the [SwiftJava](https://github.com/swiftlang/swift-java) package, package plugins, and also the `swift-java` command line tool for source generation (similar to OpenJDK jextract, if you are familiar with that concept).