To use Alloy Java API, you can use an IntelliJ project structure like this one.
The example files are taken from http://alloy.lcs.mit.edu/alloy/alloy-api-examples.html and https://alloytools.org/tutorials/online/frame-FS-7.html.
Adding Alloy jar dependency to project is possible by the following steps: [+]