<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dave Lerner</title>
    <description>The latest articles on DEV Community by Dave Lerner (@pdxgeek).</description>
    <link>https://dev.to/pdxgeek</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4046244%2F9ae4e544-dff9-4db9-8563-3f72e9e76a42.jpg</url>
      <title>DEV Community: Dave Lerner</title>
      <link>https://dev.to/pdxgeek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pdxgeek"/>
    <language>en</language>
    <item>
      <title>Stop hand-juggling JAVA_HOME: automatic per-project JDK switching with Jolta</title>
      <dc:creator>Dave Lerner</dc:creator>
      <pubDate>Sat, 25 Jul 2026 01:35:25 +0000</pubDate>
      <link>https://dev.to/pdxgeek/stop-hand-juggling-javahome-automatic-per-project-jdk-switching-with-jolta-5bja</link>
      <guid>https://dev.to/pdxgeek/stop-hand-juggling-javahome-automatic-per-project-jdk-switching-with-jolta-5bja</guid>
      <description>&lt;p&gt;If you work on more than one Java codebase, you've probably lived this: one service targets JDK 17, another needs 21, and there's a legacy app that will only ever build on 11. Every context switch means resetting JAVA_HOME, or remembering to run a version-switch command, or discovering ten minutes into a weird compiler error that you're on the wrong JDK.&lt;/p&gt;

&lt;p&gt;There are good tools for this already — SDKMAN!, jenv, asdf, mise. I've used most of them. I built Jolta because I wanted something that leaned all the way into automatic, per-project switching with as close to zero ceremony as possible, and that treated Windows as a real target. This post is the honest tour, including where the existing tools might still suit you better.&lt;/p&gt;

&lt;p&gt;Full disclosure: Jolta is my project. MIT-licensed, on GitHub at OneAppPlatform/jolta.&lt;/p&gt;

&lt;p&gt;The idea, borrowed from Node&lt;/p&gt;

&lt;p&gt;Volta solved this nicely in the Node world: you pin a tool version per project, and the right one is used automatically because your node/npm are actually lightweight shims that resolve the correct version at call time. No cd hook, no "did I remember to switch" ritual.&lt;/p&gt;

&lt;p&gt;Jolta applies that model to the JDK.&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
cd my-service&lt;br&gt;
jolta pin 21&lt;br&gt;
java -version   # → OpenJDK 21, automatically&lt;/p&gt;

&lt;p&gt;jolta pin 21 writes a .java-version file to the project. From then on, when you invoke java, javac, jar, jshell, and friends, Jolta's shims walk up the directory tree, find the nearest .java-version, and dispatch to the right JDK. Overhead is sub-5ms per call. If the pinned JDK isn't installed yet, Jolta downloads it on first use.&lt;/p&gt;

&lt;p&gt;How resolution works&lt;/p&gt;

&lt;p&gt;Jolta resolves the version to use in this order:&lt;/p&gt;

&lt;p&gt;An explicit environment variable, if set&lt;br&gt;
The project's .java-version file (found by walking up the tree)&lt;br&gt;
Your global default (jolta default 21)&lt;br&gt;
The system JDK&lt;/p&gt;

&lt;p&gt;You can also pin a specific distribution when you care:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
jolta pin corretto@21&lt;br&gt;
jolta default 21&lt;br&gt;
Why you might pick it (and why you might not)&lt;/p&gt;

&lt;p&gt;Where Jolta tries to be different:&lt;/p&gt;

&lt;p&gt;Automatic, not manual. The whole point is that you don't run a switch command per directory — the shims handle it.&lt;br&gt;
Compatible on day one. It reads the same .java-version files as jenv and asdf, and recognizes SDKMAN!'s .sdkmanrc. Migration is mostly "install Jolta and keep your existing files."&lt;br&gt;
Single dependency-free Rust binary. One static binary is both the CLI and the shims. Nothing to install into your shell beyond running jolta setup.&lt;br&gt;
Windows is first-class, alongside macOS (Apple Silicon + Intel) and Linux (x86_64 + arm64).&lt;br&gt;
Multiple distributions: Temurin, Corretto, GraalVM, Oracle, Zulu.&lt;/p&gt;

&lt;p&gt;Where the incumbents may still win for you:&lt;/p&gt;

&lt;p&gt;SDKMAN! manages far more than JDKs (Gradle, Maven, Kotlin, Scala, …). If you want one tool for your whole JVM toolchain, that breadth is real.&lt;br&gt;
mise / asdf are polyglot across many languages, so if you also manage Node/Python/Ruby versions you may prefer one manager for everything.&lt;br&gt;
Those projects are mature and battle-tested; Jolta is young.&lt;br&gt;
Installing&lt;/p&gt;

&lt;p&gt;macOS (Homebrew):&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
brew install OneAppPlatform/tap/jolta &amp;amp;&amp;amp; jolta setup&lt;/p&gt;

&lt;p&gt;Linux/macOS (one-liner):&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
curl -fsSL &lt;a href="https://raw.githubusercontent.com/OneAppPlatform/jolta/main/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/OneAppPlatform/jolta/main/install.sh&lt;/a&gt; | sh&lt;/p&gt;

&lt;p&gt;Windows: download the executable from the releases page and run jolta setup.&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
jolta setup       # install shims + shell config&lt;br&gt;
jolta catalog     # browse available versions&lt;br&gt;
jolta pin 21      # pin this project&lt;br&gt;
jolta doctor      # diagnose config issues&lt;br&gt;
Feedback wanted&lt;/p&gt;

&lt;p&gt;It's early, and the most useful thing right now is critical feedback from people with real multi-JDK setups. If you try it, I'd love to hear where the resolution logic surprised you, which vendors/distributions you need, and what would have to be true for you to switch from your current setup. Issues and comments both welcome: github.com/OneAppPlatform/jolta.&lt;/p&gt;

</description>
      <category>java</category>
      <category>rust</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
