Category Archives: Uncategorized

Java 25 Installed but Java 17 Still Active on macOS: Fixing jenv and SDKMAN Conflicts

I recently installed OpenJDK 25 using Homebrew. The installation completed successfully, but my terminal continued to report an older Java version.

The root cause turned out to be a conflict between jenv and another Java version manager. This post documents the diagnosis and the solution.

Install OpenJDK

brew install openjdk@25

Homebrew instructs you to register the JDK with macOS:

sudo ln -sfn \
/opt/homebrew/opt/openjdk@25/libexec/openjdk.jdk \
/Library/Java/JavaVirtualMachines/openjdk-25.jdk

Verify that macOS recognizes the JDK

Check that the JDK is visible to macOS:

/usr/libexec/java_home -V

You should see an entry for OpenJDK 25.

If macOS can detect the JDK, the installation itself is successful.

Add the JDK to jenv

By default, jenv does not automatically discover newly installed JDKs.

Add the JDK using:

jenv add "$(/usr/libexec/java_home -v 25)"

Verify that it has been registered:

jenv versions

You should see entries similar to:

system
25
25.0
openjdk64-25

Select Java 25

jenv global 25
jenv rehash

Confirm the selected version:

jenv version

If Java is still not changing

The most common cause is another Java installation appearing earlier in your PATH.

Check which executable is actually being used:

which java

If the result is not a jenv shim, then jenv is not controlling your shell.

Initialize jenv

Add the following near the end of your shell startup file:

export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"

Reload your shell:

source ~/.zshrc

or simply start a new terminal.

Enable JAVA_HOME management

If JAVA_HOME still points to another installation, enable the export plugin:

jenv enable-plugin export

Restart your shell afterwards.

Verify everything

which java
java --version
jenv version
echo $JAVA_HOME

Expected results:

  • which java points to a jenv shim.
  • java --version reports OpenJDK 25.
  • jenv version reports version 25.
  • JAVA_HOME is managed by jenv.

Key takeaway

Installing a JDK is only one part of the process. If multiple Java version managers are installed, whichever one appears first in your shell configuration controls the Java executable and JAVA_HOME.

If Java refuses to switch versions:

  1. Verify that macOS recognizes the JDK.
  2. Add it to jenv.
  3. Select it with jenv global.
  4. Ensure the jenv shims appear before other Java installations in your PATH.
  5. Enable the jenv export plugin so that JAVA_HOME stays synchronized.

List of good Curl commands

I use CURL for debugging my REST endpoints every now and then if I don’t want to use Postman or DHC clients. I usually like to copy paste results / statistics from command line into emails to my colleagues. This gives them a plain jane command which they can use to test themselves as well as compare their results with mine. The following article has some good pointers on how to use CURL and some very practical examples have been provided.

15 Practical Linux cURL Command Examples (cURL Download Examples)

Open IoT Stack (Internet of Things)

I came across this article on DZone which talks about Open IoT Stack for Java. This stack is envisioned to allow developers to make apps on light weight devices to build IoT solutions. This press release from Eclipse drives home the point as to why IoT is no longer a hype and much more of an imminent reality in the near future. Another report from Vision Mobile talks about how a network of app entrepreneurs might push IoT to unprecedented heights.

Akka for Reactive Programming

As I mentioned in my previous post reactive programming has a compelling reason for adoption as it allows developers to focus on their data flow and business logic. Akka has come across as a tool to enforce reactive programming. It allows you to create distributed and concurrent applications of high complexity in shorter and more manageable time frame.

FireFox OS

I have heard some good things about FireFox OS and with recent launches for ultra cheap FireFox OS based handsets in India I think that HTML based development of apps for this OS will be a different experience. I have had some reserved feelings about HTML5 development on Android and iOS platform. Somehow I felt that HTML5 development was feature limited on the mobile platform. However with FireFox OS I think I would definitely give it a try and post my experience on this blog.