Issue
- I'm encountering
java.lang.reflect.InaccessibleObjectException: Unable to make field private ... accessible
errors when starting Liferay from the Liferay IDE plugin within the Eclipse IDE with JDK 21.
Environment
- 2024.Q2.12
Resolution
The error occurs because the Liferay IDE's server startup does not include the necessary JVM arguments required for JDK 21.
To fix this manually,
- Open the Server Configuration in Liferay IDE.
- Select "Open launch configuration".
- Navigate to "Arguments" -> "VM arguments".
- Add
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED
. - Save the configuration.
Additional Information
- This issue is fixed in version 2025.Q2.