Getting Started with the Java API

The Java API will allow access to some of the Understand database from within your Java program. The Java API was written as part of creating the Understand Eclipse Plugin. For that reason it is more light weight it does not have the full capabilities of the other APIs.

To get the API working in your Java environment you will need to:

  1. Add Understand to the PATH (e.g. C:\Program Files\SciTools\bin\pc-win64)
  2. Add the Understand plugin jar file to the CLASSPATH (e.g. set CLASSPATH=.;c:\sti\bin\pc-win64\Java\com.scitools.understand.plugin_1.1.3.jar)
  3. Import the understand classes into your file (import com.scitools.understand.*;)

Documentation on the Java API is installed with Understand in the “doc” folder and is also available on our website.

While the API Tutorials do not cover the Java API directly, they can be very useful for understand the concepts and commands.

Here is a sample file that exercises the Understand Java API

import com.scitools.understand.*;
public class apitest {
public static String projPath = "d:\\projects\\pixie.udb";
public static void main(String[] args) {
//Open the Understand Database
Database db =;
// Get a list of all functions and methods
Entity [] funcs = db.ents("function ~unknown ~unresolved,method ~unknown ~unresolved");
for(Entity e : funcs){
//Find all the parameters for the given method/function and build them into a string
StringBuilder paramList = new StringBuilder();
Reference [] paramterRefs = e.refs("define","parameter",true);
for( Reference pRef : paramterRefs){
Entity pEnt = pRef.ent();
paramList.append(pEnt.type()+" "+;
//Remove trailing comma from parameter list
if(paramList.length() > 0){   
paramList.setLength(paramList.length() - 1);
}catch (UnderstandException e){
System.out.println("Failed opening Database:" + e.getMessage());