| 1 |
A small example using the Z3 Java bindings. |
| 2 |
|
| 3 |
To build the example, configure Z3 with the --java option to scripts/mk_make.py, build via |
| 4 |
make examples |
| 5 |
in the build directory. |
| 6 |
|
| 7 |
It will create JavaExample.class in the build directory, |
| 8 |
which can be run on Windows via |
| 9 |
java -cp com.microsoft.z3.jar;. JavaExample |
| 10 |
|
| 11 |
On Linux and FreeBSD, we must use |
| 12 |
LD_LIBRARY_PATH=. java -cp com.microsoft.z3.jar:. JavaExample |
| 13 |
On macOS, the corresponding option is DYLD_LIBRARY_PATH: |
| 14 |
DYLD_LIBRARY_PATH=. java -cp com.microsoft.z3.jar:. JavaExample |
| 15 |
|
| 16 |
By default, Z3 Java bindings are automatically loading the required native library for Z3 from the default library path. |
| 17 |
In certain environments, depending on the developing process, the Z3 library is not available in the given library path. |
| 18 |
To disable the automated loading process, the user can set the environment variable "z3.skipLibraryLoad=true". |
| 19 |
In that case, the calling application should directly load the corresponding libraries before any interaction with Z3. |
| 20 |
|