# SmartGit on FreeBSD



## Kalero (Jan 28, 2016)

Hi,

yesterday, I attempted to install the latest SmartGit release on my FreeBSD (10.2) and, being written in Java, it should work. But when I run the boot script I get these exceptions:


```
Error invoking SmartGit
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at QBootLoader.main(SourceFile:117)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
        at com.syntevo.q.gui.cB.a(SourceFile:53)                                                                                                                        
        at smartgit.adI.a(SourceFile:90)                                                                                                                                
        at smartgit.avS.a(SourceFile:256)                                                                                                                              
        at smartgit.avS.a(SourceFile:208)                                                                                                                              
        at smartgit.aeg.b(SourceFile:61)
        at SmartGit.main(SourceFile:11)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Display
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
```

Searching by Google, I found I need the jar file of the SWT framework for FreeBSD. I installed the package with `pkg install swt`, copied the corresponding jar file for my architecture to the smartgit's 'lib' directory and added this line to the smartgit's boot script, just before the last line (I'm attaching the boot script):


```
_VM_PROPERTIES="$_VM_PROPERTIES-Dswt.jar=$SMARTGIT_HOME/lib/org.eclipse.swt_3.104.1.v20150825-0743.jar"
```

I still get the same exceptions I pasted above. Any idea for make it work on FreeBSD? I think it would be really cool to port SmartGit to FreeBSD. Many thanks.


----------



## tobik@ (Jan 28, 2016)

I'm able to make it work by copying/linking swt.jar:
`cp /usr/local/share/java/classes/swt.jar lib/org.eclipse.swt.gtk.freebsd.x86_64.jar`



Kalero said:


> being written in Java, it should work


The surprising truth about Java is that it often doesn't or only partially.


----------



## Kalero (Jan 28, 2016)

tobik said:


> I'm able to make it work by copying/linking swt.jar:
> `cp /usr/local/share/java/classes/swt.jar lib/org.eclipse.swt.gtk.freebsd.x86_64.jar`
> 
> 
> The surprising truth about Java is that it often doesn't or only partially.



Are you able to make it work just copying the jar? Or did you need to modify the boot script? I don't know if you have done a fresh install right now and have just copied the jar or if you had done some changes before. Thanks.


----------



## tobik@ (Jan 28, 2016)

Kalero said:


> Are you able to make it work just copying the jar?


Yes, copied the jar and then ran `bash bin/smartgit.sh`

EDIT: It just crashed for me, but I was able to solve this by using x11-toolkits/swt-devel instead.


----------



## Kalero (Jan 28, 2016)

Thanks, I'll check it later


----------



## Kalero (Jan 28, 2016)

It works now, I suppose I needed the x11-toolkits/swt-devel instead. Thanks again


----------



## priyadarshan (May 10, 2017)

Unfortunately, installing x11-toolkits/swt-devel and copying 
	
	



```
/usr/local/share/java/classes/swt-devel.jar
```
 as


```
cp /usr/local/share/java/classes/swt-devel.jar lib/org.eclipse.swt.gtk.freebsd.x86_64.jar
```

does not work any more with FreeBSD 11.0-RELEASE-p9 and SmartGit 17.0.3


```
smartgit % bin/smartgit.sh
Outdated SWT version detected! Aborting.
```

Using SmartGit 8.0.4 still works, although it is not supported anymore.


----------

