npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jvm-manager-cli

v1.1.1

Published

A simple CLI to manage Java installations on Linux

Readme

jvm-manager

Linux 上的 JDK 版本管理工具。通过简单的命令安装、切换和管理不同版本的 Java。

环境要求

  • Linux (Ubuntu/Debian, Fedora/CentOS/RHEL, Arch Linux)
  • Node.js >= 14
  • sudo 权限(用于系统包管理器安装 JDK)

安装

npm install -g jvm-manager-cli

安装后,在 .bashrc 或 .zshrc 中添加 shell 集成:

eval "$(jvm init)"

重新打开终端或 source ~/.bashrc 生效。启用后 jvm use 会自动设置当前 shell 的 JAVA_HOME 和 PATH。

使用

# 安装 JDK
jvm install 17

# 查看已安装版本
jvm list

# 切换全局版本
jvm use 17

# 为当前项目指定版本 (写入 .jvmrc)
jvm use 11 --project

# 查看当前版本
jvm current

# 链接系统已有的 JDK
jvm link /usr/lib/jvm/java-17-openjdk-amd64 17

# 移除已安装版本
jvm remove 17

# 检查系统兼容性
jvm doctor

命令参考

| 命令 | 说明 | |------|------| | jvm install <version> | 安装指定版本 JDK(通过系统包管理器或 Oracle 下载) | | jvm list | 列出所有已安装的 JDK,包括系统 JDK | | jvm use <version> [--global\|--project] | 切换 JDK 版本,默认全局;--project 写入 .jvmrc | | jvm current | 显示当前全局和项目级 Java 版本 | | jvm env [--global\|--project] | 输出 export JAVA_HOME=... 等环境变量设置语句 | | jvm init | 输出 shell 集成脚本,用于 eval | | jvm remove <version> | 移除已安装的 JDK | | jvm link <path> <version> | 将系统已安装的 JDK 链接到 jvm-manager | | jvm doctor | 检查系统兼容性 |

项目级配置

在项目根目录执行 jvm use <version> --project 会创建 .jvmrc 文件。启用 shell 集成后,进入项目目录时可通过 jvm use --project 切换到项目指定版本。

常见问题

jvm use 后 java -version 没变? 需要启用 shell 集成。在 .bashrc 中添加 eval "$(jvm init)",否则需手动执行 eval "$(jvm env --global)"。

安装失败? 先手动更新包管理器:sudo apt update(Debian/Ubuntu)或 sudo yum makecache(RHEL/CentOS)。

系统已有 JDK 但 jvm-manager 找不到? 用 jvm link 手动链接:jvm link /usr/lib/jvm/java-17-openjdk-amd64 17。

开发

git clone https://github.com/veater16/jvm-manager.git
cd jvm-manager
npm install
npm link    # 本地链接为全局命令
npm test    # 运行测试

许可证

MIT