原 安装达梦数据库,调用图形界面时报错 Exception in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
现象
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | [root@kylinosv10sp2 ~]# xhost + access control disabled, clients can connect from any host [root@kylinosv10sp2 ~]# [root@kylinosv10sp2 ~]# echo $DISPLAY :10.0 [root@kylinosv10sp2 ~]# su - dmdba Last login: Thu Apr 11 19:46:24 CST 2024 on pts/1 [dmdba@kylinosv10sp2 ~]$ ll total 0 [dmdba@kylinosv10sp2 ~]$ cd /mnt [dmdba@kylinosv10sp2 mnt]$ ll total 946868 -r-xr-xr-x 1 root root 969591871 Nov 9 09:07 DMInstall.bin [dmdba@kylinosv10sp2 mnt]$ ./DMInstall.bin Extract install files.......... Exception in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] at org.eclipse.swt.SWT.error(SWT.java:4109) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:902) at org.eclipse.swt.widgets.Display.create(Display.java:890) at org.eclipse.swt.graphics.Device.<init>(Device.java:154) at org.eclipse.swt.widgets.Display.<init>(Display.java:499) at org.eclipse.swt.widgets.Display.<init>(Display.java:490) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1693) at com.dameng.common.gui.util.SWTUtility.<clinit>(SWTUtility.java:65) at com.dameng.install.ui.MainApplication.run(MainApplication.java:83) at com.dameng.install.ui.MainApplication.main(MainApplication.java:353) |
解决
首先在root用户下必须执行xhost +
,然后由于之前打印出来的$DISPLAY
为:10.0
,所以我们在dmdba下也应该export一下,且值也必须一样,如下: