[vtkusers] Compiling VTK + JAVA on solaris

Andrew Watkins andrew at dcs.bbk.ac.uk
Thu Dec 9 07:22:22 EST 2004


Hi,

I have been trying for over the last week to compile VTK 4.4.2 or 4.2.6 with Java
and have failed many times with different errors.

If any one has a complete guide it would be very usefull, since I am sure I am not the only 
one. 

Current problem is that I FINNALY got it to complile with no errors, but when I try the 
test programs I get errors:

Setup
Solaris 9/openGL 1.3/gcc 3.3/Java 1.4.2_06/VTK 4.4.2 
(Have tried Java 1.5 and gcc 2.95.3)
% cd /tmp
% cmake -i
  Main options I set:
  	BUILD_EXAMPLES:=ON
	BUILD_SHARED_LIBS=ON
	BUILD_TESTING=ON
	VTK_USE_ANSI_STDLIB=ON
	VTK_USE_HYBRID=ON
	VTK_USE_RENDERING=ON
	CMAKE_INSTALL_PREFIX:PATH=/opt/vtk
	VTK_WRAP_JAVA=ON
	JAVACOMMAND=/usr/j2se/bin/java
	JAVA_ARCHIVE=/usr/j2se/bin/jar
	JAVA_AWT_INCLUDE_PATH=/usr/j2se/include
	JAVA_AWT_LIBRARY=/usr/j2se/jre/lib/sparc/libjawt.so
	JAVA_COMPILE=/usr/j2se/bin/javac
	JAVA_INCLUDE_PATH=/usr/j2se/include
	JAVA_INCLUDE_PATH2=/usr/j2se/include/solaris
	JAVA_RUNTIME=/usr/j2se/bin/java

% gmake -i
% gmake install
% cd java/vtk
% java *.java
% cd ..
% jar cvf vtk.jar vtk/*.class

% echo $CLASSPATH
  .:/tmp/VTK/java/vtk.jar
  
% echo $LD_LIBRARY_PATH
  /opt/gnu/lib:/opt/vtk/lib/vtk:/opt/SUNWspro9/lib:/usr/openwin/lib
 
% cd /tmp/VTK/Wrapping/Java
% javac SimpleVTK.java
% java SimpleVTK
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/bbkdcs/vtk/lib/vtk/libvtkCommonJava.so: ld.so.1: java: fatal: relocation error: file 
/bbkdcs/vtk/lib/vtk/libvtkCommonJava.so: symbol _ZSt4cout: referenced symbol not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
	at java.lang.Runtime.loadLibrary0(Runtime.java:788)
	at java.lang.System.loadLibrary(System.java:834)
	at vtk.vtkPanel.<clinit>(vtkPanel.java:26)
	at SimpleVTK.<init>(SimpleVTK.java:19)
	at SimpleVTK.main(SimpleVTK.java:49)

ALSO:
% javac Regression.java
Regression.java:21: cannot resolve symbol
symbol  : method Initialize (java.lang.String[])
location: class vtk.vtkTesting
    vtkTesting.Initialize(args);
              ^
Regression.java:95: cannot resolve symbol
symbol  : variable PASSED 
location: class vtk.vtkTesting
    int retVal0 = vtkTesting.PASSED;
                            ^
Regression.java:108: cannot resolve symbol
.....


Any pointers would be great!!!


Andrew




More information about the vtkusers mailing list