How to build VTK4.4.2 on Solaris 9/10 with Java1.5
Xiaoli Dong
Sun Center of Excellence for Visual Genomics
you must compile vtk from source by yourself if
you want to use VTK with Java Wrapper enabled,
#ls -d VTK-build
VTK-build/
#gmake install
VTK will be installed into the target directory that you configured in CMake
text interface. In my case, it's VTK-install. and It will generate the following
sub directory:
bin include
lib
Build the JAR
If you're lucky, this has already been done for you by
gmake, and there's a file called vtk.jar in ~/VTK-build/bin.
However, I didn't get it and I did the following from ~/VTK-build:
#cd java
#mkdir classes/
#javac -d classes/ vtk/*.java
#cd classes/
#jar cvf vtk.jar vtk/
#jar i vtk.jar
#cp vtk.jar VTK-install
Run VTK Tutorial
In order to run tutorial, you will need vtkPanel.java get
compiled. run the following command to compile it and jar it into vtk.jar
#cd VTK/Wrapping/Java/vtk
#javac -d . vtkPanel.java vtkCanvas.java
#jar -uvf VTK-install/vtk.jar vtk
Before you run the tutorial, you need to set up the following variables:
setenv VTK VTK-install (VTK installation directory)
setenv CLASSPATH .:$VTK/vtk.jar
append the dynamic link library to your LD_LIBRARY_PATH path. I appended
the following to my LD_LIBRARY_PATH path when I running vtk in coe46
:/opt/sfw/lib:$JAVA_HOME/jre/lib//sparc/xawt:$VTK/lib/vtk
Now you are ready to test and run VTK
Download the following examples to see whether your vtk set up is all right
or not
Download
Tutorial and run the following
command:
# tar -xvf Tutorial.tar
Comile the sample program and run it.