ubuntu 16.04安装smatrgitHG工具

SmartGit/HG 是一款开放源代码的、跨平台的、支持 Git 和 Mercurial 的 SVN 图形客户端,可运行在Windows、Linux 和 MAC OS X 系统上。java

1.安装

Ubuntu及衍生系统用户安装,打开终端,使用如下命令:linux

sudo add-apt-repository ppa:eugenesan/ppa

sudo apt-get update

sudo apt-get install smartgithg

卸载命令:git

sudo apt-get remove smartgithg
2.配置

readme-linux.txt中有段设置shell

SmartGit where it can find your Java Runtime Environment. Create the file

~/.smartgit/smartgit.vmoptions and add following line (change the path)



jre=/path/to/your/jre



If you have further questions regarding the SmartGit on Linux, please ask in

our SmartGit mailing list:

java安装正常的ubuntu

$ java -version

openjdk version "9-internal"

OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)

OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

定位java环境位置是在/usr/lib/jvm/java-9-openjdk-amd64jvm

建立~/.smartgit/smartgit.vmoptions文件,内容:ide

jre=/usr/lib/jvm/java-9-openjdk-amd64
3.错误1

配置成后出现如下错误:ui

$ smartgit 

intx MaxJavaStackTraceDepth=-1 is outside the allowed range [ 0 ... 1073741823 ]

Improperly specified VM option 'MaxJavaStackTraceDepth=-1'

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

这是smartgit版本小bug引发的。开放源代码

解决:修改文件/usr/share/smartgit/bin/smartgit.shcode

_MISC_OPTS="-Xverify:none -XX:MaxJavaStackTraceDepth=-1 -Dsun.io.useCanonCaches=false"

替换为

_MISC_OPTS="-Xverify:none -XX:MaxJavaStackTraceDepth=1000000 -Dsun.io.useCanonCaches=false"

4.错误2

修改完后运行再次报错

$ smartgit 

Unsupported system classloader jdk.internal.loader.ClassLoaders$AppClassLoader@d7b1517

问题貌似是java9暂不支持smartgit,把java-9-openjdk-amd64卸载,从新装/java-8-openjdk-amd64。同时更新~/.smartgit/smartgit.vmoptions配置文件。

运行成功!

5.建立smartgit桌面启动

~/Desktop/建立文件smartgit.desktop,内容为:

[Desktop Entry]

Name=SmartGit

Comment=Git client

Keywords=Git;Subversion;

StartupNotify=true

Terminal=false

Type=Application

Categories=Application;

Icon=/usr/local/bin/smartgit/bin/smartgit-48.png

Exec=/usr/local/bin/smartgit/bin/smartgit.sh %F

赋予smartgit.desktop可执行属性:

$ chmod a+x smartgit.desktop


REF:

1.Smartgit install error on Ubuntu [closed]

相关文章
相关标签/搜索