Overview

The Java sample programs in the STEP Tools® software documentation are source code packed as zipfiles. Save the package to local disk and then unzip.

You can build and run from the command line or with an IDE like Eclipse. In either case, you must add the jars for the base STEP Tools® software classes and the IFC schema classes to your classpath.

On the command line, you can find these jars through the ROSE environment variable as shown below. This example uses the base STEP Tools® software jar, and a jar containing classes for the ifc2x3 model.

# windows
> javac -cp "%ROSE%\lib\java\stdev.jar;%ROSE%\lib\java\ifc2x3lib.jar" MakeGeometry.java
> java  -cp "%ROSE%\lib\java\stdev.jar;%ROSE%\lib\java\ifc2x3lib.jar;." MakeGeometry

# unix
> javac -cp "$ROSE/lib/java/stdev.jar;$ROSE/lib/java/ifc2x3lib.jar" MakeGeometry.java
> java  -cp "$ROSE/lib/java/stdev.jar;$ROSE/lib/java/ifc2x3lib.jar;." MakeGeometry

With Eclipse, we suggest setting a classpath variable called ROSE_JAVA that points to the STEP Tools® software jar directory, so you can refer to jars in a portable way.

In the properties dialog under Project | Properties, select Java Build Path and the Libraries tab. Then use Add Variable | Configure Variables | New to create a classpath variable called ROSE_JAVA that points to the STEP Tools® software jar folder. To reference each jar, select Add Variable, choose ROSE_JAVA and use Extend to pick the stdev.jar or AP jarfiles like ifc2x3lib.jar, ap203lib.jar, etc.