Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented Oct 24, 2025

This simplifies the setup a little bit

  • use latest Gradle 9.1 (compatible with recent android studio); the same that swift-java uses so there will be less "re-downloading" gradle stuff
  • update hashing example readme for someone first time doing any java at all -- include pointers to installing the android sdk and an appropriate JDK
  • lift the specific JDK requirement

Near future simplifications: None of this JDK requiring would matter once we can release swift-java artifacts, but this is still an ongoing process -- hopefully soon we'll be able to, and then we can remove all this jdk installing and local publishing from this guide.

@ktoso
Copy link
Collaborator Author

ktoso commented Oct 24, 2025

This follows up @davelester's request to make the setup as simple and consistent as possible.

We don't actually need JDK 25 except when releasing swift-java which itself only has one module which needs it, but to make things as simple as possible for now, let's just keep recommending the latest so folks don't have to flip-flop between multiple JDKs, especially if they're new to Java.

Please double check this @madsodgaard.

I took these steps from "nothing installed" and these are pretty fool-proof AFAICS, so should be safe to link to from a blog.

Copy link
Collaborator

@madsodgaard madsodgaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments about explicitly stating the requirement of JDK 25 for the swift-java example. Otherwise, it works fine on my end 👍

@ktoso ktoso requested a review from madsodgaard October 24, 2025 09:05
Copy link
Member

@finagolfin finagolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking this, few language nits.

@finagolfin
Copy link
Member

Alright, merge when you're ready.

shahmishal and others added 2 commits October 24, 2025 09:16
@timsneath
Copy link
Collaborator

Just added a pull request for this because I don't have direct write access: #8

Update README with sdkman installation instructions
@finagolfin
Copy link
Member

This is just waiting for Mishal to merge, I think everybody else is good.

@shahmishal
Copy link
Member

@justice-adams-apple is verifying the instructions.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that I needed to have JAVA_HOME set at a system level (via zprofile) before launching android studio for the swiftpm invocation of swift-java to work. I assume this is expected since the JNI headers aren't found in the JBR installation at /Applications/Android Studio.app/Contents/jbr/Contents/Home ?

Other than that the instructions worked with JDK 25 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's follow up on this with future PR. Thanks!

@shahmishal shahmishal merged commit de35c0a into main Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants