Java examples

VisIt's Java API is written in pure Java and it allows Java applications to control VisIt's viewer from Java. This means that your Java application can launch VisIt's viewer window and control it programmatically, even replacing VisIt's GUI with your own custom Java GUI.

Disclaimers:

  • VisIt will not draw its plots inside of your Java application. VisIt's separate viewer window will be activated and controlled from your application.
  • VisIt will not be able to plot data from your Java application without going through the file system.

Both of these disclaimers can be explained by examining VisIt's High level design. You can find documentation for the Java API on the Java API documentation page.

Example programs

These pages link to online versions of the example programs found in VisIt's src/java directory. If you enter the src/java directory in VisIt and "make main", the example programs will be built. Then you can run them as indicated in the following pages:

JAR file

When you type make in the src/java directory, the core parts of the VisIt Java interface get compiled. However, if you want a JAR file, you'll have to type make pack. The pack target causes a JAR file to be created and then packaged up with the Java source code and example programs into a TAR file that can be gzipped and put up on the VisIt download page. The visit.jar file will be present in the src/java directory after typing make pack. If you want to run the example programs, type make main to build their class files.


# Running an example program
java -cp .:visit.jar RunViewer -dv -stay