如果用:System.load(System.getProperty( "user.dir ") + "/dllDir/libipc.so ");
结果:
Exception in thread "main " java.lang.UnsatisfiedLinkError: /home/lyf/lyfShareDir/RdbJni/dllDir/libipc.so: /home/lyf/lyfShareDir/RdbJni/dllDir/libipc.so: undefined symbol: shm_unlink
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
at java.lang.Runtime.load0(Runtime.java:770)
如果用:System.loadLibrary( "libipc.so ");//已经设置了LD_LIBRARY_PATH变量
结果:Exception in thread "main " java.lang.UnsatisfiedLinkError: no libipc.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
------解决方案--------------------
看看存不存在这个文件/home/lyf/lyfShareDir/RdbJni/dllDir/libipc.so