javaup

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

javaup

English | 简体中文

Use the correct Java toolchain for every Maven project — automatically.

Latest release Go version CI Platform License

javaup (command: jup) is a Java toolchain manager built for Maven projects. It detects the Java version required by a project, selects a matching installed JDK, and remembers the project's Maven installation path, JDK, and optional settings.xml. Every subsequent build reuses this toolchain, so there is no need to change JAVA_HOME or PATH in the current shell or manually switch between versions.

javaup demo

[!IMPORTANT] jup selects JDKs and Maven installations that are already present. It does not download or uninstall them. Apache Maven is the only supported build tool in v0.3.0.

Install

macOS or Linux:

curl -fsSL https://github.com/codeboyzhou/javaup/releases/latest/download/install.sh | sh

Windows PowerShell 5.1 or later:

irm https://github.com/codeboyzhou/javaup/releases/latest/download/install.ps1 | iex

Prebuilt releases support Windows, macOS, and Linux on amd64 and arm64. See the installation guide for checksums, go install, source builds, and installer options.

Quick Start

The Maven project needs a pom.xml, Maven Wrapper or mvn on PATH, and a matching full JDK installed locally.

cd /path/to/your/maven-project
jup init
jup status
jup run mvn clean package

In an interactive terminal, jup run mvn can select any initialized project and ranks frequently and recently used projects first. In CI or redirected pipelines, it resolves the nearest initialized project without prompting.

What It Does

  • Detects Java requirements from POM properties, compiler plugin configuration, and local parent POMs.
  • Prefers Maven Wrapper and falls back to Maven from PATH.
  • Finds installed JDKs through Maven, environment variables, PATH, Maven Toolchains, and common platform locations.
  • Applies the selected JDK and optional Maven settings alias only to the spawned build process.
  • Manages and diagnoses initialized projects globally without modifying project source files.

See Why javaup? for a detailed comparison with manual environment switching, SDKMAN!, asdf, jEnv, Maven Wrapper, and Maven Toolchains.

Documentation

Current Scope

Maven is currently the only supported build tool. JDKs and Maven must already be installed, and saved project/tool paths are local absolute paths. Maven settings aliases store paths only, never file contents or credentials. See the project scope for the complete boundaries.

Contributing

Bug reports, compatibility cases, documentation improvements, and code contributions are welcome. Run the complete local verification pipeline with:

go mod download
go run build.go verify

Read CONTRIBUTING.md before submitting a pull request.

License

Licensed under the Apache License 2.0.

Documentation

Overview

Command build runs the complete local verification and build pipeline.

Directories

Path Synopsis
cmd
jup command
Command jup manages Java versions from the command line.
Command jup manages Java versions from the command line.
internal
apphome
Package apphome resolves javaup's per-user application directory.
Package apphome resolves javaup's per-user application directory.
atomicfile
Package atomicfile writes files through a temporary sibling and rename.
Package atomicfile writes files through a temporary sibling and rename.
buildinfo
Package buildinfo exposes values that can be replaced at build time.
Package buildinfo exposes values that can be replaced at build time.
buildtool
Package buildtool defines abstractions shared by project build tool detectors.
Package buildtool defines abstractions shared by project build tool detectors.
buildtool/maven
Package maven detects Apache Maven project configuration.
Package maven detects Apache Maven project configuration.
cli
Package cli implements the jup command-line interface.
Package cli implements the jup command-line interface.
javainfo
Package javainfo discovers installed Java development kits.
Package javainfo discovers installed Java development kits.
javaversion
Package javaversion parses the major component of Java version strings.
Package javaversion parses the major component of Java version strings.
mavensettings
Package mavensettings manages named Maven settings files.
Package mavensettings manages named Maven settings files.
project
Package project coordinates project detection and local configuration.
Package project coordinates project detection and local configuration.
selfupdate
Package selfupdate downloads and installs javaup releases.
Package selfupdate downloads and installs javaup releases.
uninstall
Package uninstall removes an installer-managed javaup installation.
Package uninstall removes an installer-managed javaup installation.
winprocess
Package winprocess centralizes Windows command interpreter and detached PowerShell helper process behavior.
Package winprocess centralizes Windows command interpreter and detached PowerShell helper process behavior.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL