java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jdk1.5.0_05\bin\netSock.dll: ??????ó??ò???ò????????ó??òδ???????????°????ó??ò????~??????????
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at com.aaa.netSock.NetSock.<clinit>(NetSock.java:6)
Exception in thread "main"
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at com.aaa.netSock.NetSock.<clinit>(NetSock.java:6)
Exception in thread "main"
也许由于文件夹存在空格什么的莫名其妙的原因也不一定。将dll换个浅路径试试看,或者换个dll试试看
dll放到你的启动目录下。
参考信息:
Here are all the reasons I've documented for unsatisfied linking errors...The code to load a native library is System.loadLibrary("name"). Unsatisfied linker errors can be due to a number of reasons. The most common is an incorrect naming of the native library for the name passed to the loadLibrary function. The text passed to the loadLibrary function must not include the extension name in the text, that is .dll or .so. The text must be 'name' and not 'libname' for all platforms. On Windows the native library must then be called name.dll and on Unix it must be called libname.so. If you are debugging using java -debug, then the native library must be called name_g.dll on Windows and libname_g.so on Unix.Another common reason for the native library not loading is because it is not in your path. On Unix make sure that your LD_LIBRARY_PATH contains the path to the native library. On Windows make sure the PATH environment variable contains the path to the native library. Note that on Unix systems LD_LIBRARY_PATH must be set to '.' if the native library is in the current directory. This is unlike Windows which always looks in the current directory.The native library will also not load if there are any unresolved symbols in the compiled C/C++ code. Unresolved symbols will be described if you use the -verbose:jni commandline switch when running java.Ensure that you are using the correct C/C++ compiler and linker combination and options for successful native library loading. If your native library has to link with another shared objects (DLL), it will not necessarily link successfully if it was generated from another compiler or even an older version of the same compiler.
建议把 dll 放到C:\WINDOWS\system32下