我试图在我的Scala代码中启动gnuplot。
我使用ProcessBuilder来启动外部进程。
但是,当我启动gnuplot时:
gnuplot -p <generated script>
所以,就像:
Seq("gnuplot", "-p", scriptname).!
I get:
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gnuplot: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
似乎我需要调用XInitThreads 我的问题是:
- 如何从Java调用该本地方法(我假设我可以在我的Scala代码中使用它),或者直接从Scala中调用该方法?
- 是否可能存在其他问题?