libjvm.so does not function correctly if it is brought into the process using dlopen. It must be linked into the executable when that object is created.
Workaround: Explicitly name libjvm.so (-ljvm) and libjava.so (-ljava) as dependencies when you create an executable.