[vtkusers] Java UnsatisfiedLinkError using "java -jar xxx.jar" but succeed by double click the xxxfile.jar

林可 cqqlin at gmail.com
Thu Apr 28 21:51:45 EDT 2011


Hi, I compressed a vtk java wrapper demo in to a jar file, in which those
vtk libraries are used:
System.loadLibrary("vtkCommonJava");
System.loadLibrary("vtkFilteringJava");
System.loadLibrary("vtkIOJava");
System.loadLibrary("vtkImagingJava");
System.loadLibrary("vtkGraphicsJava");
System.loadLibrary("vtkRenderingJava");

The strange result is when I double-click the xxx.jar file, it runs well;
but when I use a command line and type "java -jar xxx.jar", I will encounter
an UnsatisfiedLinkError when loading vtkRenderingJava except which the other
lib files are correctly loaded.

here is my environment:
- Win32 XP
- vtk5.6.1
- jdk 1.6.0_22
- cmake 2.8.4
- visual studio express 2008

I also use Eclipse to run the demo directly, it also runs well. So I felt
very strange.

I am wondering if there are some jvm arguments I missed when try to launch
by "java -jar xxx.jar", or some other reasons, thanks in advance.

I am sure the vtk bin library is included in the "PATH" variant, for my
java.library,path is as follows:

C:\sdk\Java\jdk1.6.0_22\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\sdk\Java\jdk1.6.0_22\jre\bin;C:/sdk/Java/jdk1.6.0_22/bin/../jre/bin/client;C:/sdk/Java/jdk1.6.0_22/bin/../jre/bin;
C:\sdk\vtk-5.6.1\VTKbin\bin\Debug;C:\dev\tools\apache-ant-1.7.0\bin;C:\sdk\Java\jdk1.6.0_22\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\notes;c:\Program
Files\XLView;C:\Utilities;C:\lotus\component;C:\Program Files\IBM\Personal
Communications\;C:\Program Files\IBM\Trace
Facility\;C:\lotus\compnent;C:\Program Files\Intel\WiFi\bin\;C:\Program
Files\ThinkPad\ConnectUtilities;C:\MySQL\MySQL Server 5.5\bin;C:\Program
Files\TortoiseSVN\bin;C:\Program Files\CMake
2.8\bin;C:\sdk\python\Python27;C:\sdk\python\Python27\Scripts;C:\Program
Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual
Studio\Common\Tools;C:\Program Files\Microsoft Visual
Studio\VC98\bin;C:\Program Files\SSH Communications Security\SSH Secure
Shell

Sincerely,
Kevin Lin
2011-04-29
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110429/05331598/attachment.htm>


More information about the vtkusers mailing list