diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b30abe8..3c41994 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Aug 09 13:51:11 EEST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hello-swift-library/README.md b/hello-swift-library/README.md index 6f82316..3047ba0 100644 --- a/hello-swift-library/README.md +++ b/hello-swift-library/README.md @@ -13,7 +13,7 @@ The project consists of: Before you can build and run this project, you need to have the following installed: -* **Java Development Kit (JDK)**: We recommend using JDK 21. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. +* **Java Development Kit (JDK)**: We recommend using JDK 25. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. * **Swiftly**: You need to install [Swiftly](https://www.swift.org/install/) * **Swift SDK for Android**: You need to install the [Swift SDK for Android](https://swift.org/install) diff --git a/hello-swift/README.md b/hello-swift/README.md index 8bd5172..7104af5 100644 --- a/hello-swift/README.md +++ b/hello-swift/README.md @@ -15,7 +15,7 @@ The project consists of: Before you can build and run this project, you need to have the following installed: -* **Java Development Kit (JDK)**: We recommend using JDK 21. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. +* **Java Development Kit (JDK)**: We recommend using JDK 25. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. * **Swiftly**: You need to install [Swiftly](https://www.swift.org/install/) * **Swift SDK for Android**: You need to install the [Swift SDK for Android](https://swift.org/install) diff --git a/native-activity/README.md b/native-activity/README.md index b74ccc0..4d76082 100644 --- a/native-activity/README.md +++ b/native-activity/README.md @@ -15,7 +15,7 @@ The project consists of: Before you can build and run this project, you need to have the following installed: -* **Java Development Kit (JDK)**: We recommend using JDK 21. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. +* **Java Development Kit (JDK)**: We recommend using JDK 25. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. * **Swiftly**: You need to install [Swiftly](https://www.swift.org/install/) * **Swift SDK for Android**: You need to install the [Swift SDK for Android](https://swift.org/install) * **Device/emulator with OpenGL ES support** diff --git a/swift-java-hashing-example/README.md b/swift-java-hashing-example/README.md index 347df5f..4d1921a 100644 --- a/swift-java-hashing-example/README.md +++ b/swift-java-hashing-example/README.md @@ -19,14 +19,40 @@ The project is structured into two main parts: Before you can build and run this project, you need to have the following installed: -* **Java Development Kit (JDK)**: We recommend using JDK 21. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. +* **Java Development Kit (JDK)**: This example requires the use of JDK 25. This is only necessary to locally publish the swift-java dependencies, and will not be required in the future. To simplify the build steps, we recommend installing JDK 25 and following all the steps below using the same JDK. Ensure the `JAVA_HOME` environment variable is set to your JDK installation path. * **Swiftly**: You need to install [Swiftly](https://www.swift.org/install/) * **Swift SDK for Android**: You need to install the [Swift SDK for Android](https://swift.org/install) ## Setup and Configuration +### Prepare Swift Android SDK and matching Swift + +Currently these examples utilize very recent nightly Swift Android SDK versions. In order to install these, you can use Swiftly (the Swift toolchain installer): + +You can follow [these instructions](https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html) to install an appropriate Swift SDK for Android. + ### Publish `swift-java` packages locally -As the `swift-java` project does not yet publish the neccessary Java packages needed at runtime, we need to do it ourself, by performing the following steps: +As the `swift-java` project does not yet publish the necessary Java packages needed at runtime, we need to do it ourselves, by performing the following steps: + +> Note: This step will not be necessary once swift-java publishes releases. + +In order to publish all artifacts from this library, you must use JDK 25, because some parts of swift-java are built for the most recent Java versions. You will not have to use JDK 25 for the rest of the development process. +A simple way to install and manage local Java installations is [sdkman](https://sdkman.io): + +> Note: You will _not_ have to use most recent Java versions for your Android app, and the example currently targets Java language version 11. + +Here's how to install `sdkman`: +```bash +curl -s "https://get.sdkman.io" | bash +``` +Now restart the terminal so that the `sdk` utility is added to your path, and then set JDK 25 as your current Java install. + +```bash +sdk install java 25.0.1-amzn --use # only in order to publish swift-java artifacts locally +export JAVA_HOME="${HOME}//.sdkman/candidates/java/current" +``` + +Next, let's prepare and publish the swift-java support libraries: 1. Enter the `hashing-lib` directory ```bash diff --git a/swift-java-hashing-example/hashing-lib/build.gradle b/swift-java-hashing-example/hashing-lib/build.gradle index 13da81e..818f756 100644 --- a/swift-java-hashing-example/hashing-lib/build.gradle +++ b/swift-java-hashing-example/hashing-lib/build.gradle @@ -17,9 +17,8 @@ android { } java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } dependencies {