File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes JNI + X11 questionss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JNI + X11 questionss" Watch "JNI + X11 questionss" New topic

JNI + X11 questionss

skip coon

Joined: Feb 01, 2003
Posts: 13
Hey All,
I am running xorg-x11 for my X server. I am using C for the native calls. I am quite certain that the C-code that I have written works just fine on it's own but when I compile to a shared library and use it with java, I get this:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/scoon/Desktop/JNI/X11/ /home/scoon/Desktop/JNI/X11/ undefined symbol: XOpenDisplay
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at jX11.<clinit>(

I compile my shared library using these 2 steps:

gcc -I$JAVAHOME/include -I$JAVAHOME/include/linux -I/usr/X11R6/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/X11R6/include -L/usr/X11R6/lib X11_Imp.c -c -o libcX11.o

ld -shared -o libcX11.o

I think this is an include problem, so I am wondering if anyone has had any experience w/ this?

Thanks in advance,
I agree. Here's the link:
subject: JNI + X11 questionss
It's not a secret anymore!