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 in solaris (urgent) 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 in solaris (urgent)" Watch "JNI in solaris (urgent)" New topic

JNI in solaris (urgent)

mou haj
Ranch Hand

Joined: Sep 12, 2001
Posts: 81
Can any body help me...
i know how to call c functions from java code using JNI... we create a dll of the C program... but what should i do for Solaris
? please help
Dragon Liu

Joined: Sep 12, 2001
Posts: 22
hi mou haj:
Maybe I can help you .
you can build a dll file on windows.
so the step on Solaris is very similar!
Step 1:
On Solaris, the following command builds a shared library example:
cc -G -I/usr/local/java/include -I/usr/local/java/include/solaris \
HelloWorldImp.c -o
Step two:
After you do that,you can invoke the native method in java.
If you see an exception like the following, then you don't have your library path set up correctly.
java.lang.UnsatisfiedLinkError: no hello in shared library path
at java.lang.Runtime.loadLibrary(
at java.lang.System.loadLibrary(
at java.lang.Thread.init(
use the following to set your library path.
% setenv LD_LIBRARY_PATH mylibrarypath
where mylibrarypath is the name of the directory that contains

Hello,This is my question
mou haj
Ranch Hand

Joined: Sep 12, 2001
Posts: 81
Thanx a l-o-t dragon lui
I agree. Here's the link:
subject: JNI in solaris (urgent)
It's not a secret anymore!