--add-exports java.base/jdk.internal.misc=ALL-UNNAMED - please fix the docs! #186

Closed
@hrstoyanov

Description

Environment Details

  • EclipseStore Version: 1.3.1
  • JDK version: 21.0.2
  • OS: MacSO Sonoma 14.3.1
  • Describe the bug

    The EclipseStore documentation says that in order to enable persistence for Java records, one need to run the JVM with :

    --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
    

    That does not solve the issue in all cases, and I found out that when using fully modularized app, one needs to actually use:

    --add-exports java.base/jdk.internal.misc=java.base/jdk.internal.misc=org.eclipse.serializer.base
    

    So, you may want to document both options?

    Additional context

    If you read the Java 21 docs for Javac ALL-UNAMED works for unnamed/legacy jars only :

    --add-exports module/package=other-module(,other-module)*

    Specifies a package to be considered as exported from its defining module to additional modules or to all unnamed modules when the value of other-module is ALL-UNNAMED.