用于 Java 的“类 RVM"工具 [英] 'RVM-like' tool for Java

查看:24
本文介绍了用于 Java 的“类 RVM"工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种可以让我切换正在运行的 Java 实现的工具,例如 Ruby 的 RVM(或 RBENV).我知道 Debian 系统提供了替代机制,我可以手动设置 JAVA_HOME.

I am looking for a tool that would let me switch the running Java implementation, like Ruby's RVM (or RBENV). I am aware that Debian systems provide the alternatives mechanism, and that I can set JAVA_HOME manually.

但是,如果可能的话,我想要更自动化的东西.如果它可以获取 JDK,那就更好了,但不是必需的.

However, I'd like something more automated if possible. If it could fetch JDKs that would be even better, but not necessary.

我已经搜索过,但没有看到类似的东西.我猜 Java 生态系统已经习惯了在 IDE 中拥有此功能.

I've searched but didn't see anything like it. My guess the Java ecosystem got used to having this functionality in an IDE.

更改 PATH 和 JAVA_HOME 似乎工作正常.它可以简单地自动化.

Changing PATH and JAVA_HOME seems to work fine. It could be trivially automated.

推荐答案

我认为没有这样的工具.每个平台都有自己的系统.Debian/Ubuntu、RedHat/CentOS 和 SLE/OpenSUSE(可能还有其他一些发行版)使用替代机制.Mac OSX 有自己的内置切换机制来更改当前使用的 JVM.

I think there is no such tool. Every platform has hits own system. Debian/Ubuntu, RedHat/CentOS and SLE/OpenSUSE ( probably some other distributions as well) use the alternative mechanism. Mac OSX has its own buildin switching mechanism to change the current used JVM.

我必须维护很多开发人员工作站和服务器.所有基于 *nix(OSX、Linux、Solaris)并用于在目录中安装所有 JVM 并创建指向应使用版本的符号链接 CURRENT.指向当前符号链接的 JAVA_HOME 和 PATH 变量.如果我想使用另一个版本,只需移动 CURRENT 符号链接.无需采取进一步措施.

I have to maintain a lot of developer workstations and servers. All *nix based (OSX, Linux, Solaris) and used to install all JVMs in a directory and create a symlink CURRENT to the Version that should be used. The JAVA_HOME and PATH variable pointing to this CURRENT symlink. If Ia want to use another version only haf to move the CURRENT symlink. No further actions are necessary.

不幸的是,这种方法不适用于基于 Windows 的系统.

Unfortunately this approach does not work for Windows based systems.

这篇关于用于 Java 的“类 RVM"工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆