[vtkusers] Using VTK w/ Java - Can't get past VtkInit error

Mona Wong-Barnum mona at ncmir.ucsd.edu
Thu Dec 4 17:55:55 EST 2003


Hi Fran:

	Please excuse me if I'm stating the obvious...your email said that you 
are not a Java developer and just helping out a professor...
	
	1.  Let's say your vtk.jar is in /usr/local/lib/vtk/
	
	2.  First, you need to compile the code with:
	
	    javac -classpath /usr/local/lib/vtk/vtk.jar Cone.java
	
	3.  Then you run it:
	
	    java -classpath /usr/local/lib/vtk/vtk.jar:. Cone
	    
	Those steps worked for me.  Hope that helps.
	
cheers,
Mona

> More generally, I've yet to get Java-based Vtk working.  I receive an
> UnsatisfiedLinkError when JNI (I presume) attempts to find VTKInit.  If
> someone could point towards what VTKInit is and what library it lives
> in, that might help me determine why it can't be found from the Java
> wrappers.  Or, from the vtkCommonJava.so that's being called from the
> Java wrappers, anyhow.  And then I can at least massage my
> LD_LIBRARY_PATH and similar to see if that helps.
> 
> Sorry to be so basic - I'm not a C++ or Java developer - I'm a sysadmin
> helping a professor to set this up for him and his students.  I've no
> knowledge of Vtk (or C++) programming itself.  Any help would be much
> appreciated.
> 
> Original message from yesterday is below.
> 
> Thanks,
> Fran
> 
> On Wed, 2003-12-03 at 17:04, Fran Fabrizio wrote:
> > I get this error when trying to run the Step1/Cone example from the
> > Tutorial directory in the Examples...
> > 
> > [fran at freeman Java]# java Cone
> > Exception in thread "main" java.lang.UnsatisfiedLinkError: VTKInit
> >         at vtk.vtkConeSource.VTKInit(Native Method)
> >         at vtk.vtkObject.<init>(vtkObject.java:98)
> >         at vtk.vtkProcessObject.<init>(vtkProcessObject.java:86)
> >         at vtk.vtkSource.<init>(vtkSource.java:86)
> >         at vtk.vtkPolyDataSource.<init>(vtkPolyDataSource.java:30)
> >         at vtk.vtkConeSource.<init>(vtkConeSource.java:114)
> >         at Cone.main(Cone.java:33)
> > [fran at freeman Java]#
> > 
> > I have made sure that vtk.jar is in the classpath (by dropping it into
> > my ext directory).  I have export LD_LIBARY_PATH=/usr/local/lib/vtk/ so
> > it can find the libraries.  I have googled on this error without any
> > luck.  Does anyone know what I could try next?
> > 
> > Incidentally, the C++ version of Cone compiles and runs flawlessly.
> > 
> > Thanks,
> > Fran
> > 

==================================================================
Mona Wong-Barnum
National Center for Microscopy and Imaging Research
University of California, San Diego
http://ncmir.ucsd.edu/

"Circumstances don't make a man, they reveal him"
			-- James Allen
==================================================================





More information about the vtkusers mailing list