Rainbow command line: dependency errors seemingly linked to Eclipse

37 views
Skip to first unread message

Julien Paulhan

unread,
Nov 23, 2016, 8:41:10 AM11/23/16
to okapi-devel
Hi guys,

This is not extremely important (at least I can find another way to do what I want to do) but I noticed a small problem when trying to run rainbow from the command line :

julien@ubuntuSERVER:~/okapi/lib$ java -jar rainbow.jar -x TranslationKitCreation /home/julien/test.html -o /home/julien/test/xliff
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
        at org.eclipse.swt.SWT.error(Unknown Source)
        at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
        at org.eclipse.swt.widgets.Display.create(Unknown Source)
        at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
        at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
        at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
        at net.sf.okapi.applications.rainbow.Main.main(Main.java:33)


Before that, there was another error, that mentioned missing libraries, so for the record, if anyone bumps into it I could fix that one by installing package "libswt-gtk-3-java" on my Ubuntu Server 16.04 LTS


julien@ubuntuSERVER:~/okapi/lib$ java -jar rainbow.jar -x TranslationKitCreation /home/julien/test.html -o /home/julien/test/xliff
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
        no swt-pi-gtk-4528 in java.library.path
        no swt-pi-gtk in java.library.path
        /home/julien/.swt/lib/linux/x86_64/libswt-pi-gtk-4528.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
        Can't load library: /home/julien/.swt/lib/linux/x86_64/libswt-pi-gtk.so

        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
        at net.sf.okapi.applications.rainbow.Main.main(Main.java:33)

I want to insist on the fact that this is Ubuntu Server with no desktop environment, no graphical anything (it seems there is a need for gtk2 as well), because I don't have a need for it. This is a bit of a pity that I'm not able to run through command line, when all I need is to generate files. I am not installing Eclipse just to run this command... ;)
FYI, this is the same machine where I run Longhorn, which runs great as expected.

Of course, if I am doing something wrong, please let me know!
Thanks,

Julien

Chase Tingley

unread,
Nov 23, 2016, 2:28:01 PM11/23/16
to okapi...@googlegroups.com
Oh, interesting.

It's not really a dependency on Eclipse, just on SWT, which is the graphics library that Eclipse uses (but which can also be used for other applications).

I think you solved the first error in an appropriate way by installing that dependency.  However, the second error looks like it's happening because the initialization code is trying to get a display handle, but you don't have a display.

This is probably a bug in rainbow -- the display shouldn't be initialized until after we check to see if it's just a command-line invocation.

--
You received this message because you are subscribed to the Google Groups "okapi-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chase Tingley

unread,
Nov 23, 2016, 2:36:53 PM11/23/16
to okapi...@googlegroups.com
Now that I think about it, the fix is probably a little more involved because some of the command-line options still use/affect the UI.  I think it's only -x and -pln that are purely CLI mode.

Chase Tingley

unread,
Nov 23, 2016, 2:38:29 PM11/23/16
to okapi...@googlegroups.com
Filed as issue #570.

Julien Paulhan

unread,
Nov 23, 2016, 3:02:30 PM11/23/16
to okapi-devel
Thanks for the feedback, Chase.
Yes indeed, the issue is caused by the lack of display. This mention came up online as one of the possible causes for this error.
If Rainbow is meant to be used both in command line and graphical mode however, won't that possibly make the jar file too bloated? Would it be preferable to have a different jar for the command line and to use shared libraries? Just an idea here, no clue whether it's relevant or not in Java with your dev environment.
Anyway as I run all the framework for tests on Ubuntu server VMs with as little installed as possible, I'll update you if I run into such issues in the future!
Thanks for your continued support.

Yves Savourel

unread,
Nov 23, 2016, 3:17:13 PM11/23/16
to okapi...@googlegroups.com
Yes, ideally we should have a two distinct interfaces (one CL-only, one UI) using the same separate shell to trigger the different functions both Tikal and Rainbow offer.

But they've been developed at different time and don't completely overlap at present. For example, you can't run a custom-define pipeline from Tikal.

-ys
--
You received this message because you are subscribed to the Google Groups "okapi-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-devel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages