'类似于RVM的' Java工具 [英] 'RVM-like' tool for Java

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

问题描述

我正在寻找一种能让我切换正在运行的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(可能还有其他一些发行版)也使用 alternative 机制。 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到应使用的版本。指向此CURRENT符号链接的JAVA_HOME和PATH变量。如果Ia要使用其他版本,则只能移动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.

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

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