# Issue with Java modules - missing parameter add-exports

**URL:** <https://discuss.kotlinlang.org/t/issue-with-java-modules-missing-parameter-add-exports/15208>\
**Category:** Support\
**Created:** [November 28, 2019, 8:31am UTC](https://discuss.kotlinlang.org/t/issue-with-java-modules-missing-parameter-add-exports/15208 "2019-11-28T08:31:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IKupriyanov](https://avatars.discourse-cdn.com/v4/letter/i/59ef9b/32.png) [@IKupriyanov](https://discuss.kotlinlang.org/u/IKupriyanov)\
**Post date:** [November 28, 2019, 8:31am UTC](https://discuss.kotlinlang.org/t/issue-with-java-modules-missing-parameter-add-exports/15208/1 "2019-11-28T08:31:51Z")

</div>

I need to use not exported java classes from `sun` package. It’s not a general task rather required hack, I need to use these classes on predefined and fixed JVM version on a concrete platform.

With plain java it’s pretty trivial to make them visible - I only need to export them manually with `--add-exports` parameter. However with Kotlin I got into trouble:

- koltin compiler doesn’t support `--add-exports`
- passing `--add-exports` parameter to `javaCompile` task (Gradle) fails - [kotlin compiler checks module accessibility by itself and gives an error](https://github.com/JetBrains/kotlin/blob/1.3.60/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/JvmModuleAccessibilityChecker.kt#L79).

I saw a similar topic with [relevant example](https://discuss.kotlinlang.org/t/using-sun-awt-image-with-java-11/15127/3). So for simplicity let’s assume that I need the same `sun.awt.image` class.

Is there any way to export these classes with kotlin? Other solutions are also welcome.

---

<div class="post-metadata">

**Author:** ![chenzhijian1995](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@chenzhijian1995](https://discuss.kotlinlang.org/u/chenzhijian1995)\
**Post date:** [March 29, 2022, 12:20pm UTC](https://discuss.kotlinlang.org/t/issue-with-java-modules-missing-parameter-add-exports/15208/2 "2022-03-29T12:20:24Z")

</div>

Write on the first line of the file `@file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE")`
