if you want call it directly from java code, it won't work because jvm does not recognize it. But you can write a proxy so file which would call the fun function.
example
void *handler= dlopen("libxxx.so", RTLD_LAZY);//open the so
void *(*fun)(); //the definition of the fun pointer you want to call
fun = (void *(*)())dlsym(handler,"fun"); // get the dynsym
fun(); //call it
note: need check : handler != NULL && fun != NULL
you can get the dynamic symbol use readelf tool in linux