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: [+]
- open File menu
- go to Project Structure
- select Modules section
- go to Dependencies tab
- add a JAR or directories... dependency by + button
- select Alloy jar file