ナレッジベース
公開されました Jun. 30, 2025

Liferay IDE: Resolving 'Unable to make field private' errors with JDK 21

written-by

Stanley Huang

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

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,

  1. Open the Server Configuration in Liferay IDE.
  2. Select "Open launch configuration".
  3. Navigate to "Arguments" -> "VM arguments".
  4. Add --add-opens=java.base/sun.util.calendar=ALL-UNNAMED.
  5. Save the configuration.

Additional Information

  • This issue is fixed in version 2025.Q2.
did-this-article-resolve-your-issue

ナレッジベース