使用另一个java版本启动smartgit

问题描述 投票:0回答:2

我尝试使用另一个 java 版本在 Ubuntu 14.10 32 位上启动 smartgit 6.5。

在文件中

/usr/share/smartgit/bin/smartgit.sh
说:

# To specify an alternative Java Runtime Environment, set the environment
# variable SMARTGIT_JAVA_HOME or add a
#
# jre=/path/to/jre
#
# line to smartgit.vmoptions (see below).
#
# To specify additional VM options, add them to smargit.vmoptions
# or ~/.smartgit/smartgit.vmoptions files.

在这里我找到了如何编辑文件的答案:

gedit ~/.smartgit/smartgit.vmoptions

所以我只是输入:

jre=/usr/lib/jvm/java-7-openjdk-i386/bin/java

我想,这应该改变 smartgit 中使用的 java 版本(在菜单“帮助”->“信息”中可见)

但事实并非如此!还在继续

1.7.0_72-b14 (/usr/lib/jvm/java-7-oracle/jre)

这个文件必须是什么样子才能使用另一个 Java 引擎?

java smartgit
2个回答
6
投票

我找到了解决方案:当你在控制台上启动 smartgit 时:

smartgit-start 

您收到警告:

警告:/usr/lib/jvm/java-7-openjdk-i386/bin/java/bin/java 不存在

该路径中有一个双

/bin/java
,因此您只需输入
bin
文件夹的路径:

gedit ~/.smartgit/smartgit.vmoptions

然后输入:

jre=/usr/lib/jvm/java-7-openjdk-i386

这会使用该版本启动 smartgit


既然现在你总是必须在控制台上启动 smartgit,一个较小的文件会很方便:创建一个文件

/usr/local/sbin/smg

cd /tmp;
nohup /usr/share/smartgit/bin/smartgit.sh &

并赋予其可执行权限:

chmod +x /usr/local/sbin/smg

现在你可以在任何地方启动 smartgit

smg

0
投票

同时......旧版本仍然需要 JRE 8:

sudo dnf install java-1.8.0-openjdk

导致这些结果

smartgit.vmoptions

jre=/usr/lib/jvm/jre-1.8.0-openjdk
© www.soinside.com 2019 - 2024. All rights reserved.