[vtkusers] [EXTERNAL] problems running a vtk java bindings example

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Oct 26 13:50:26 EDT 2015


Hi Gerrick,

You right VTK is not able to load the native dll/so at runtime from the
native.jar.

But that's definitely the goal, with also the publication to the maven repo
of those native bundles.
This way (when we get to it, or if the community help), vtk could just be
declared as a maven dependency without having to worry about building it.

On the other hand the command line/option you are talking about is
-Djava.library.path=/some/dir, but I'm not sure it will work either. It
seems you really need to get your environment variable properly setup.
(Window: PATH, Linux: LD_LIBRARY_PATH, osx: DYLD_LIBRARY_PATH)

Seb

On Mon, Oct 26, 2015 at 11:38 AM, Gerrick Bivins <
Gerrick.Bivins at halliburton.com> wrote:

> Hi Henry,
> It looks like you are trying to reference the jar that has the natives in
> them.
> Last time I tried,unless you have some special handling code to extract
> the natives for your platform from that vtk-6.1-natives-Linux-x86_64.jar,
> I don't think you'll not be able to load the native dll's/so's at runtime.
> Vtk just isn't setup to do that for us.
>
> Currently, to run with java you need to extract those dll's/so's to some
> directory
> and then set your PATH/LD_LIBRARY_PATH etc to point to the directory and
> then run.
> I think you can also set some command line arg that will tell
> vtkNativeLibraries
> where to load them from.
> Gerrick
> -----Original Message-----
> From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Henry Blanco
> Sent: Monday, October 26, 2015 10:49 AM
> To: vtkusers at vtk.org
> Subject: [EXTERNAL] [vtkusers] problems running a vtk java bindings example
>
> Hello guys, I have set up and compiled VTK through cmake on a 64-bits
> Ubuntu 14.04, just to get VTK Java bindings, but I have failed to run a
> simple "Cone.java" example. Specifically, when I try to execute the
> statement:
>
> System.loadLibrary("vtkCommonJava");
>
> The compiler throws the following error:
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
> vtkCommonJava in java.library.path
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
>         at java.lang.Runtime.loadLibrary0(Runtime.java:849)
>         at java.lang.System.loadLibrary(System.java:1088)
>         at Cone.<clinit>(Cone.java:17)
>
> --------------------------------------
> To specify what my problem is, please, read these comments:
>
> 1- The VTK compilation process produced the following .jar files (both
> placed at /usr/local/ directory):
>         vtk-6.1.jar
>         vtk-6.1-natives-Linux-x86_64.jar
>
> 2- The library files "vtkCommonJava.o" is not among those produced by the
> compilation process.
> 3- The most similar library file to "vtkCommonJava" that I have found is
> "libvtkCommonCoreJava.o", packed into the jar file
> "vtk-6.1-natives-Linux-x86_64.jar". I have included this file into the
> "Java Build Path" of my Eclipse IDE, as well as the jar file "vtk-6.1.jar",
> but still the program fails to run.
>
> I will appreciate any suggestions on what is missing here to run the java
> example. Thanks in advance.
>
> Henry
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151026/25234abd/attachment.html>


More information about the vtkusers mailing list