[vtkusers] java Exception with vtk

Eric E. Monson emonson at cs.duke.edu
Thu Feb 21 06:50:51 EST 2008


Hey,

I don't know for sure if this is the problem, but to get VTK Java to  
work I have to set these two environment variables (either on the  
command line or in my .profile for the bash shell):

export CLASSPATH=/Users/emonson/Programming/VTK/build/bin/vtk.jar:.
export JAVA_LIBRARY_PATH=/Users/emonson/Programming/VTK/build/bin

of course, with you own paths to vtk.jar and the VTK/build/bin  
directories. Notice the first one includes looking in the current  
directory with the colon separator and the full stop (period).

-Eric


On Feb 21, 2008, at 4:19 AM, wells wrote:

> hi
> I ran a single java program, and throw an exception. like following:
>
> DanyLeeMacbook-4:dist wells$ java -jar vtkSample.jar  
> java.library.path:.:/Library/Java/Extensions:/System/Library/Java/ 
> Extensions:/usr/lib/java
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no  
> vtkCommonJava in java.library.path
> 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1753)
> 	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> 	at java.lang.System.loadLibrary(System.java:1030)
> 	at vtk.vtkPanel.<clinit>(vtkPanel.java:26)
> 	at vtksample.VTKSample.main(VTKSample.java:32)
>
> then I and path into java.library.path ,like following:
>
>
>
> DanyLeeMacbook-4:dist wells$ java -D java.library.path=":/Library/ 
> Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:/Users/ 
> wells/vJavaBin/lib/Extensions" -jar vtkSample.jar
> Exception in thread "main" java.lang.NoClassDefFoundError: java/ 
> library/path=:/Library/Java/Extensions:/System/Library/Java/ 
> Extensions:/usr/lib/java:/Users/wells/vJavaBin/lib/Extensions
> Caused by: java.lang.ClassNotFoundException:  
> java 
> .library 
> .path 
> = 
> :.Library 
> .Java 
> .Extensions 
> :.System 
> .Library 
> .Java.Extensions:.usr.lib.java:.Users.wells.vJavaBin.lib.Extensions
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
>
>
> There are dylibs in "/Users/wells/vJavaBin/lib/Extensions" .
>
> Can any one help me! Thanks !
>
> -wells
>
>
> _______________________________________________
> This is the private VTK discussion list.Please keep messages on- 
> topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080221/f01850a8/attachment.htm>


More information about the vtkusers mailing list