[vtkusers] VTK+java application for distribution

Gerrick Bivins Gerrick.Bivins at halliburton.com
Tue May 21 08:52:46 EDT 2013


A nice RCP framework (NetBeans Platform for Swing or Eclipse RCP for SWT) can also help you out here.
Both frameworks have "compile time" ways of dealing with natives so when you run  you don't have to rely
on setting paths before launching.  
NetBeans Platform:
http://wiki.netbeans.org/DevFaqNativeLibraries
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#jni

Eclipse RCP (OSGi)  which I'm just getting started with:
http://robertvarttinen.blogspot.com/2008/12/bundle-nativecode-in-osgi-manifest.html
http://stackoverflow.com/questions/12912772/how-to-use-osgi-fragments-to-contribute-platform-dependent-native-code-with-the

Although it's not the "silver bullet" (non-transitive dll  loading for example) and an RCP app might be more than you need at the moment,
it's another option that I've had pretty good success with. 

The overall benefits of an RCP app can't be beat IMO, see:

https://netbeans.org/features/platform/features.html
https://netbeans.org/features/platform/showcase.html
https://netbeans.org/features/platform/index.html

http://eclipsezone.com/eps/10minute-rcp/




-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Simeon Fitch
Sent: Tuesday, May 21, 2013 7:22 AM
To: vtkusers at vtk.org
Subject: Re: [vtkusers] VTK+java application for distribution

Mahendra,

Out of the box Java does not extract shared libraries out of a JAR file and load them. There are third party libraries and code samples online that do this, but to my knowledge VTK hasn't integrated with any of them. Without such supporting framework, the typical way of handling this is to *not* include the shared libraries in your JAR file, but have them in a directory extracted with whatever distribution installer or archive format you use, and have whatever launcher script/program pass that path to Java with "-Djava.library.path=...". I think "-Dvtk.lib.dir=..." is supposed to work too, but I've had less luck with that on windows and the other variable seems to work on all platforms I've tried.

I've found this link helpful:

http://www.vtk.org/Wiki/VTK/Java_Wrapping

Here's the VTK utility code (template) that supports the loading process.

https://github.com/Kitware/VTK/blob/master/Wrapping/Java/vtk/vtkNativeLibrary.java.in






--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-java-application-for-distribution-tp5720775p5720796.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.



More information about the vtkusers mailing list