码迷,mamicode.com
首页 > 其他好文 > 详细

使Docker Container支持运行SWT程序

时间:2015-02-28 14:17:11      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:

1, 下载安装JDK的docker container

我是从这个源下载已经做好的JDK8的container:

https://registry.hub.docker.com/u/dockerfile/java/

docker run -it --rm dockerfile/java:oracle-java8

 

2, 添加GUI支持

有好几种方案,我使用的是这种:

http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/

还有一种是:

https://pelle.io/2014/07/11/delivering-gui-applications-with-docker/

我没有试过。

 

3,安装swt-gtk

但是这时候运行swt程序,还是会抛如下错误:

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-gtk-3740 in java.library.path no swt-gtk in java.library.path Can‘t load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk-3740.so

Can‘t load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk.so

需要:

1) 添加architecture i386

sudo dpkg --add-architecture i386

sudo apt-get update

参考:

http://askubuntu.com/questions/463457/how-to-find-packages-when-updating-ubuntu-and-creating-standard-source-list-file

http://askubuntu.com/questions/551840/unable-to-locate-package-libc6-dbgi386-in-docker

 

2)安装gtk

sudo apt-get install libgtk2.0-0:i386

参考:

http://askubuntu.com/questions/232691/cannot-open-shared-object-file-no-such-file-or-directory

 

3)安装swt支持

sudo apt-get install libswt-gtk-3-jni libswt-gtk-3-java

并拷贝到

sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86_64/

参考http://askubuntu.com/questions/125150/unsatisfied-link-error-and-missing-so-files-when-starting-eclipse

使Docker Container支持运行SWT程序

标签:

原文地址:http://www.cnblogs.com/Binhua-Liu/p/4305201.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!