ubuntu 16.04安装smatrgitHG工具

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

1.安装

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


sudo add-apt-repository ppa:eugenesan/ppa

sudo apt-get update

sudo apt-get install smartgithg

卸载命令:


sudo apt-get remove smartgithg

2.配置

readme-linux.txt中有段设置


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安装正常的


$ 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-amd64

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


jre=/usr/lib/jvm/java-9-openjdk-amd64

3.错误1

配置成后出现以下错误:


$ 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.sh

_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]

posted @ 2016-10-04 19:27  Eliefly  阅读(1712)  评论(0编辑  收藏  举报