Lombok is a great plugin that has an installer for Eclipse and IntelliJ. AnyLogic is Eclipse-based, so how do we get it to work there too?
How do I make AnyLogic recognize the Lombok plugin?
On a Mac, this is the most recent process:
- Go to Applications, right click on AnyLogic, and select Show Package Contents
- Copy
lombok.jar
toContents/MacOS
- Edit
AnyLogic.ini
. Add-javaagent:lombok.jar
on a line by itself after-vmargs
Windows and Linux are similar.
Very interesting, did not know this was possible, but I assume only applicable if all team members make use of the same plugin, since the code Lombok creates is not in the ALP file? –
Surprint
Yup, but if you're designing with Lombok as a key pillar you'd just enforce everyone to use it anyway, if for no other reason than their code wouldn't compile. –
Apparatus
I am curious to know if this will be compatible with AL 9 coming the end of this year. Since it is now browser-based it might not use the Eclipse technology in the same way it used to. –
Surprint
As long as it has a Java backend this approach should work in some way or another.
-javaagent
AFAIK is a JVM thing and not an Eclipse thing. –
Apparatus On Windows it might be necessary to set it using `-javaagent:./lombok.jar'. Also don't forget to import lombo.jar as a library dependency. –
Stannary
In Windows: Lombok.jar needs to be added to AnyLogic program files too, not only the model, to be able to launch Anylogic. –
Metabolic
On windows, this process is a bit different and following the below steps can save you some time:
- Download the Lombok JAR from the official website: https://projectlombok.org/download
- Open your local drive where your programs get saved and open the "Programs Files".
- Open the AnyLogic folder and copy and paste the Lombok.jar file in there.
- Write click on the Anylogic.ini file and navigate to Properties, under security, make sure that you have the "Write and modify" permission.
- Open the Anylogic.ini file with your preferred text editor app, and Add
-javaagent:lombok.jar
on a line by itself after-vmargs
. You might need to first run your text editor app as the administrator before opening the .ini file. - Save and close the .ini file and return to Anylogic.
© 2022 - 2025 — McMap. All rights reserved.