[vtk-developers] Exception in thread "main" java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path

Robert Häckl robert_haeckl at fear-gfx.de
Wed Feb 19 12:36:27 EST 2014


I guess we come nearer to the solution :-)
First of all I looked here how to load libraries:
http://www.vtk.org/Wiki/VTK/Java_Wrapping

The snipped I added to my main was:

if  (!vtkNativeLibrary.LoadAllNativeLibraries())  {
             for  (vtkNativeLibrary lib:  vtkNativeLibrary.values())  {
                 if  (!lib.IsLoaded())  {
                     System.out.println(lib.GetLibraryName()  +  " not loaded");
                 }
             }
         }
         vtkNativeLibrary.DisableOutputWindow(null);



And then i got those printings on my console:

vtkCommonJava not loaded
vtkFilteringJava not loaded
vtkGeovisJava not loaded
vtkGraphicsJava not loaded
vtkHybridJava not loaded
vtkImagingJava not loaded
vtkInfovisJava not loaded
vtkIOJava not loaded
vtkRenderingJava not loaded
vtkViewsJava not loaded
vtkVolumeRenderingJava not loaded
vtkWidgetsJava not loaded
vtkChartsJava not loaded

So I know that the libraries are not loaded. This is a complete step 
further, but what I now need to know is, how to load the libraries.


Am 19.02.2014 17:56, schrieb Sebastien Jourdain:
> Ok, so the first step works... If you provide half of the facts we 
> will provide only half of the fix. ;-)
>
> Which means, you are missing the load library call inside your 
> Java/Scala code...
> Your environment is properly set, but now, you need to tell the JVM to 
> load those libraries.
> The VTK examples do have that piece of code and I guess, that you did 
> not call it before using a VTK class inside your Java/Scala environment.
>
> Seb
>
>
>
>
> On Wed, Feb 19, 2014 at 9:47 AM, Robert Häckl 
> <robert_haeckl at fear-gfx.de <mailto:robert_haeckl at fear-gfx.de>> wrote:
>
>     I exactly tried this commands and they did not work for me. Only
>     when I'm using the second command with java -cp
>     /path-to-vtk/lib/vtk.jar your.main.class I can for example start a
>     vtk demo. But when I try my scala project, i got the error again:
>
>     Exception in thread "main" java.lang.UnsatisfiedLinkError: no
>     vtkCommonJava in java.library.path
>     I have set the LD_LIBRARY_PATH in my Development Environment, too.
>     I'm using Intellij IDEA. Maybe it would be interesting, that my
>     project is a maven project with using scala. I checked out this
>     maven project: https://github.com/chris1412/PlanetSim and this
>     should work out of the box because vtk is already installed as a
>     maven dependency. I don't get it, how to fix my problem because I
>     have tried several solutions.
>
>     Am 19.02.2014 17:23, schrieb Sebastien Jourdain:
>>     I'm making things up here, but it should look like that on linux:
>>
>>     export LD_LIBRARY_PATH=/path-to-vtk/lib
>>     java -cp /path-to-vtk/lib/vtk.jar your.main.class
>>
>>     Seb
>>
>>     PS: Please keep the list in the loop.
>>
>>
>>     On Wed, Feb 19, 2014 at 9:15 AM, Robert Häckl
>>     <robert_haeckl at fear-gfx.de <mailto:robert_haeckl at fear-gfx.de>> wrote:
>>
>>         Hi Sebastian!
>>
>>         I tried several path settings, but always not to an *.so file.
>>         Would you please show me a example where I could find the
>>         *.so file which I need and how the command looks like which I
>>         have to do?
>>
>>         Thanks a lot
>>
>>         Robert
>>
>>
>>         Am 19.02.2014 15:46, schrieb Sebastien Jourdain:
>>>         Hi Robert,
>>>
>>>         Did you set the following environment variable to contain
>>>         the path to the directory that contains all the VTK libraries?
>>>
>>>         - Win (*.dll): PATH
>>>         - Linux (*.so): LD_LIBRARY_PATH
>>>         - Mac (*.dylib): DYLD_LIBRARY_PATH
>>>
>>>         Seb
>>>
>>>
>>>         On Wed, Feb 19, 2014 at 4:17 AM, Robert Häckl
>>>         <robert_haeckl at fear-gfx.de
>>>         <mailto:robert_haeckl at fear-gfx.de>> wrote:
>>>
>>>             I'm a computer science student and at the moment I do
>>>             the implementation of my master thesis. The topic is
>>>             about to simulate particles and optimizing agents. But
>>>             with using vtk, i ran in some troubles. I always get
>>>             this error:
>>>             Exception in thread "main"
>>>             java.lang.UnsatisfiedLinkError: no vtkCommonJava in
>>>             java.library.path
>>>
>>>             I already asked lots of google sites and no solution
>>>             worked for me. I tried it a working project with vtk on
>>>             another machine where it worked just fine. So you are my
>>>             last hope.
>>>             I'm using Ubuntu 13.10 and on the other machine Windows
>>>             7. On both I got the same error. Furthermore I use the
>>>             Intellij IDEA and open-jdk 7 for linux.
>>>
>>>             Yours sincerely
>>>
>>>             Robert
>>>
>>>             _______________________________________________
>>>             Powered by www.kitware.com <http://www.kitware.com>
>>>
>>>             Visit other Kitware open-source projects at
>>>             http://www.kitware.com/opensource/opensource.html
>>>
>>>             Follow this link to subscribe/unsubscribe:
>>>             http://www.vtk.org/mailman/listinfo/vtk-developers
>>>
>>>
>>>
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20140219/1eda082b/attachment-0002.html>


More information about the vtk-developers mailing list