SmartGit/HG 是一款開放源代碼的、跨平臺的、支持 Git 和 Mercurial 的 SVN 圖形客戶端,可運行在Windows、Linux 和 MAC OS X 系統上。java
Ubuntu及衍生系統用戶安裝,打開終端,使用如下命令:linux
sudo add-apt-repository ppa:eugenesan/ppa sudo apt-get update sudo apt-get install smartgithg
卸載命令:git
sudo apt-get remove smartgithg
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-amd64
jvm
建立~/.smartgit/smartgit.vmoptions
文件,內容:ide
jre=/usr/lib/jvm/java-9-openjdk-amd64
配置成後出現如下錯誤: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.sh
code
把
_MISC_OPTS="-Xverify:none -XX:MaxJavaStackTraceDepth=-1 -Dsun.io.useCanonCaches=false"
替換爲
_MISC_OPTS="-Xverify:none -XX:MaxJavaStackTraceDepth=1000000 -Dsun.io.useCanonCaches=false"
修改完後運行再次報錯
$ smartgit Unsupported system classloader jdk.internal.loader.ClassLoaders$AppClassLoader@d7b1517
問題貌似是java9暫不支持smartgit,把java-9-openjdk-amd64
卸載,從新裝/java-8-openjdk-amd64
。同時更新~/.smartgit/smartgit.vmoptions
配置文件。
運行成功!
在~/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: