explaingit

fidothe/chjava

Analysis updated 2026-07-12 · repo last pushed 2021-11-30

ShellAudience · developerComplexity · 1/5DormantSetup · easy

TLDR

chjava is a lightweight macOS command-line tool that lets you quickly switch between installed versions of Java with a single command, including automatic switching per project folder.

Mindmap

mindmap
  root((repo))
    What it does
      Switch Java versions
      Fuzzy version matching
      Auto switch per project
    Platform
      macOS only
      Apple Silicon support
      Intel Java fallback
    Use cases
      Legacy app maintenance
      Multi-project development
      Quick version toggling
    Philosophy
      Minimalist script
      Single env var only
      No downloads or installs
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Switch between Java 8 and Java 17 for different projects without manually editing environment variables.

USE CASE 2

Set up a config file in a project folder so Java automatically switches when you navigate into it.

USE CASE 3

Run Intel-based versions of Java on Apple Silicon Macs for legacy project compatibility.

What is it built with?

ShellJava

How does it compare?

fidothe/chjavaalexbloch-ia/legal-datachloevpin/kiro-arm64
Stars00
LanguageShellShellShell
Last pushed2021-11-30
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity1/52/53/5
Audiencedevelopergeneralops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires macOS with one or more versions of Java already installed via standard macOS installer paths.

No license information was provided in the explanation, so the usage rights are unknown.

In plain English

chjava is a lightweight command-line tool for macOS that lets you quickly switch between different versions of Java. If you work on multiple projects that each require a specific version of Java, this tool saves you from the repetitive, error-prone process of manually updating your system's Java configuration every time you switch folders. On macOS, Java looks for a specific environment variable to know which version to use. Normally, changing that variable requires typing out a long, cumbersome command. This tool simplifies that to a single command. You just type something like "chjava 17" to instantly set Java 17 as your active version. It also supports fuzzy matching, so asking for version 11 will automatically find the latest installed version of 11 on your machine. On newer Apple Silicon Macs, it can even help you run Intel-based versions of Java if a specific project requires it. This tool is designed for developers who frequently switch between Java versions and want a minimalist solution. For example, if you maintain an older application that runs on Java 8 but also build new services on Java 17, you can use this tool to toggle between them in seconds. It also supports automatic switching: if you place a small configuration file in your project folder, the tool will automatically change your Java version the moment you navigate into that project in your terminal. What stands out about this project is its strict commitment to doing one thing and doing it with as little overhead as possible. The creator intentionally avoided adding extra features like downloading and installing new versions of Java or interfering with other system settings. It is built as a very small script and only modifies the single environment variable that controls your active Java version. This makes it a straightforward, predictable utility for people who want to avoid heavier, more complex development tools.

Copy-paste prompts

Prompt 1
Write a shell script that mimics chjava by accepting a version number, fuzzy-matching it against installed Java versions in /Library/Java/JavaVirtualMachines, and exporting the correct JAVA_HOME.
Prompt 2
Create a .java-version file that I can drop into a project folder so my terminal automatically switches to Java 17 when I cd into it.
Prompt 3
Show me how to install and configure chjava on macOS so I can switch between Java 11 and Java 21 by typing a single command.

Frequently asked questions

What is chjava?

chjava is a lightweight macOS command-line tool that lets you quickly switch between installed versions of Java with a single command, including automatic switching per project folder.

What language is chjava written in?

Mainly Shell. The stack also includes Shell, Java.

Is chjava actively maintained?

Dormant — no commits in 2+ years (last push 2021-11-30).

What license does chjava use?

No license information was provided in the explanation, so the usage rights are unknown.

How hard is chjava to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is chjava for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.