Search code examples
androidjava-platform-module-system

State of JPMS in Android


What is the current state of JPMS support in Android?

If I define a module, does Android honor the public/internal separation or does Android just ignore module-info?


Solution

  • As of the current state in 2024, Android does not have full support for the Java Platform Module System introduced in Java 9. This means that while you can define a module-info.java file and include it in your project, the Android runtime does not enforce the module boundaries or visibility rules defined by JPMS. While you can define and compile modules using module-info.java in an Android project, the runtime does not honor the module system's access controls. This means that public/internal separation defined in module-info.java will be ignored at runtime on Android.