同时运行两个版本的java [英] Running two versions of java at same time

查看:693
本文介绍了同时运行两个版本的java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用两个版本的java(1.6.21和1.7)。我公司的代码依赖于1.6_21,我们计划使用artifactory。我们正在本地测试artifactory.But artifactory需要java 1.7或更高版本。我希望我的默认java home指向1.6_21,而对于artifactory它应该是1.7。

I have to use two versions of java (1.6.21 and 1.7).My company's code is dependent on 1.6_21 and we are planning to use artifactory. We are testing artifactory locally.But artifactory needs java 1.7 or higher.I want my default java home to point to 1.6_21 and for artifactory it should be 1.7.

但是问题是我安装java 7后,它将自己设置为默认值。我已经阅读了许多帖子,解释了如何管理两个版本的java,但我的artifactory和eclipse必须同时运行。

But the problem is as soon as I install java 7,it sets itself as default.I have read many posts that explain how to manage two versions of java,but my artifactory and eclipse have to run at same time.

请帮忙!!

推荐答案

您需要使用批处理脚本(Windows)或shell脚本(Linux)来执行工件,并设置JAVA_HOME到你想要执行的Java版本的路径

You'll need to use batch script (Windows) or a shell script (Linux) to execute artifactory, and set JAVA_HOME to the path of the Java version you want to execute

这篇关于同时运行两个版本的java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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