emt4j icon indicating copy to clipboard operation
emt4j copied to clipboard

How to obtain the contents of the file jdk_default_export_to_unnamed.cfg

Open qiuchenjian opened this issue 10 months ago • 3 comments

Hi, jdk_default_export_to_unnamed.cfg is used to filter out the unwanted add-exports option.

           if (jdkDefaultExportToUnnamed.contains(packageName.get())) {
                continue;
            }

how to obtain the contents of the file jdk_default_export_to_unnamed.cfg? such as the ‘sun.awt’ , i think it shoud add '--add-exports=java.desktop/sun.awt=ALL-UNNAMED' , but it is in jdk_default_export_to_unnamed.cfg

qiuchenjian avatar Apr 29 '24 02:04 qiuchenjian

The content of jdk_default_export_to_unnamed.cfg is from https://github.com/openjdk/jdk11u-dev/blob/master/src/java.base/share/classes/jdk/internal/module/jdk8_packages.dat

D-D-H avatar Apr 29 '24 03:04 D-D-H

The content of jdk_default_export_to_unnamed.cfg is from https://github.com/openjdk/jdk11u-dev/blob/master/src/java.base/share/classes/jdk/internal/module/jdk8_packages.dat

thanks for reply to the source of cfg.

import sun.awt.AppContext;
public class Main {
    public static void main(String[] args) {
        AppContext appContext = AppContext.getAppContext();
    }
Main (in unnamed module @0x1a86f2f1) cannot access class sun.awt.AppContext (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x1a86f2f1

this example should be suggested to add '--add-exports=java.desktop/sun.awt=ALL-UNNAMED', it didn't, i think it's caused by ‘sun.awt’ in jdk_default_export_to_unnamed.cfg

qiuchenjian avatar Apr 29 '24 06:04 qiuchenjian

It seems that we misunderstood the functionality of jdk_8_packages.dat. I'll make an investigation.

D-D-H avatar May 06 '24 03:05 D-D-H