How do I make AnyLogic recognize the Lombok plugin?
Asked Answered
A

2

5

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?

Apparatus answered 30/8, 2021 at 3:21 Comment(0)
A
6

On a Mac, this is the most recent process:

  1. Go to Applications, right click on AnyLogic, and select Show Package Contents
  2. Copy lombok.jar to Contents/MacOS
  3. Edit AnyLogic.ini. Add -javaagent:lombok.jar on a line by itself after -vmargs

Windows and Linux are similar.

Apparatus answered 30/8, 2021 at 3:21 Comment(6)
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
M
1

On windows, this process is a bit different and following the below steps can save you some time:

  1. Download the Lombok JAR from the official website: https://projectlombok.org/download
  2. Open your local drive where your programs get saved and open the "Programs Files".
  3. Open the AnyLogic folder and copy and paste the Lombok.jar file in there.
  4. Write click on the Anylogic.ini file and navigate to Properties, under security, make sure that you have the "Write and modify" permission.
  5. 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.
  6. Save and close the .ini file and return to Anylogic.
Mismanage answered 20/8, 2024 at 9:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.