VTK/Tutorials/JavaEnvironmentSetup: Difference between revisions

From KitwarePublic
< VTK‎ | Tutorials
Jump to navigationJump to search
(Created page with '* Download and install the sun JDK: http://java.sun.com/javase/downloads/widget/jdk6.jsp (Throughout the following we will assume it is installed in /opt/java, though you can ins…')
 
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* Download and install the sun JDK: http://java.sun.com/javase/downloads/widget/jdk6.jsp
* Download and install the sun JDK: http://java.sun.com/javase/downloads/widget/jdk6.jsp
(Throughout the following we will assume it is installed in /opt/java, though you can install it wherever you please)
(Throughout the following we will assume it is installed in /opt/java, though you can install it wherever you please)
* Use the following CMake settings:
 
** JAVA_ARCHIVE              /home/seb/Kitware/opt/jdk1.6.0_18/bin/jar
* Add /opt/java/jre/lib/i386 and /opt/java/jre/lib/i386/xawt to LD_LIBRARY_PATH as well as the VTK libraries (in ~/.bashrc)
** JAVA_AWT_INCLUDE_PATH        /home/seb/Kitware/opt/jdk1.6.0_18/include  
 
** JAVA_AWT_LIBRARY         /home/seb/Kitware/opt/jdk1.6.0_18/jre/lib/amd64/libjawt.so
* Add /opt/java/bin to your PATH
** JAVA_COMPILE                  /home/seb/Kitware/opt/jdk1.6.0_18/bin/javac
 
** JAVA_INCLUDE_PATH      /home/seb/Kitware/opt/jdk1.6.0_18/include
* In your ~/.bashrc, add
** JAVA_INCLUDE_PATH2    /home/seb/Kitware/opt/jdk1.6.0_18/include/linux
export JAVA_HOME=/opt/java
** JAVA_JVM_LIBRARY          /home/seb/Kitware/opt/jdk1.6.0_18/jre/lib/amd64/server/libjvm.so
 
** JAVA_RUNTIME                /home/seb/Kitware/opt/jdk1.6.0_18/bin/java
* The Java relevant paths that CMake should find are:
JAVA_AWT_INCLUDE_PATH            /opt/java/include
JAVA_AWT_LIBRARY                 /opt/java/jre/lib/i386/libjawt.so
JAVA_INCLUDE_PATH                /opt/java/include
JAVA_INCLUDE_PATH2              /opt/java/include/linux
JAVA_JVM_LIBRARY                /opt/java/jre/lib/i386/client/libjvm.so
Java_JAR_EXECUTABLE              /opt/java/bin/jar
Java_JAVAC_EXECUTABLE            /opt/java/bin/javac
Java_JAVA_EXECUTABLE            /opt/java/bin/java
 
* You can now run VTK Java scripts as follows:
javac -cp ".:/home/doriad/bin/VTK/bin/vtk.jar" ClassName.java
java  -cp ".:/home/doriad/bin/VTK/bin/vtk.jar" ClassName
 
==Fedora specific instructions==
*yum install java-devel
 
==Common Errors==
*  CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
JAVA_AWT_INCLUDE_PATH (ADVANCED)

Latest revision as of 13:40, 27 May 2010

(Throughout the following we will assume it is installed in /opt/java, though you can install it wherever you please)

  • Add /opt/java/jre/lib/i386 and /opt/java/jre/lib/i386/xawt to LD_LIBRARY_PATH as well as the VTK libraries (in ~/.bashrc)
  • Add /opt/java/bin to your PATH
  • In your ~/.bashrc, add
export JAVA_HOME=/opt/java
  • The Java relevant paths that CMake should find are:
JAVA_AWT_INCLUDE_PATH            /opt/java/include
JAVA_AWT_LIBRARY                 /opt/java/jre/lib/i386/libjawt.so
JAVA_INCLUDE_PATH                /opt/java/include
JAVA_INCLUDE_PATH2               /opt/java/include/linux
JAVA_JVM_LIBRARY                 /opt/java/jre/lib/i386/client/libjvm.so
Java_JAR_EXECUTABLE              /opt/java/bin/jar
Java_JAVAC_EXECUTABLE            /opt/java/bin/javac
Java_JAVA_EXECUTABLE             /opt/java/bin/java
  • You can now run VTK Java scripts as follows:
javac -cp ".:/home/doriad/bin/VTK/bin/vtk.jar" ClassName.java
java  -cp ".:/home/doriad/bin/VTK/bin/vtk.jar" ClassName

Fedora specific instructions

  • yum install java-devel

Common Errors

  • CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
JAVA_AWT_INCLUDE_PATH (ADVANCED)