on Solaris UNIX, in a Java program, i am embedding C calls.
im native linking a C object to a Java application.

javac -jni <appname>.java
g++ -c <appname>.c

The java class and the C .o file get generated fine.
When i run java -Djava.library.path="." <appname>,
it gives

java.lang.UnsatisfiedLinkError: no <appname> in java.library.path

However, in my program, i have done a
System.out.println("Path=" + System.getProperty("java.library.path"));
and this prints
the current path fine.

Could you please let me know where this is going wrong ?
Is there something related to shared library ?

Could we have a Java Program via JNI make calls to C++ library ?
instead of a C library ? i have read that only C interface via JNI is supported.