Fix compilation against JRE 9 on JPS

Write the modular JDK (9+) path to the module.xml file passed to the
compiler from the JPS plugin. This path is then recorded in the compiler
configuration in KotlinToJVMBytecodeCompiler.configureSourceRoots. This
is needed because in JPS plugin, we pass "-no-jdk" and thus no JDK home
path was recorded in the compiler configuration in
K2JVMCompiler.setupJdkClasspathRoots. Presence of JDK home path in the
configuration is crucial for JDK 9 support (see
KotlinCoreEnvironment.Companion.createApplicationEnvironment), because
classes there can only be loaded with the special "jrt" file system, not
as .class files in .jar files

 #KT-17801 Fixed
This commit is contained in:
Alexander Udalov
2017-05-16 13:04:10 +03:00
parent f8dabc79c3
commit 965b4199f4
16 changed files with 158 additions and 21 deletions
+8
View File
@@ -0,0 +1,8 @@
<modules>
<!-- Module script for production -->
<module name="name" type="java-production" outputDir="output">
<!-- Java source roots -->
<!-- Classpath -->
<modularJdkRoot path="/path/to/modular/jdk"/>
</module>
</modules>