summaryrefslogtreecommitdiff
path: root/java/system_modules.go
diff options
context:
space:
mode:
author Sorin Basca <sorinbasca@google.com> 2023-12-21 11:49:29 +0000
committer Sorin Basca <sorinbasca@google.com> 2023-12-21 11:49:35 +0000
commit088e079803239036a079b28d8670d97b90bd1bcc (patch)
treed5546709e3d87768a55f324d196eccf845e2432d /java/system_modules.go
parent0760c898821150912da273bb1030485c5df35b19 (diff)
Change target platform to LINUX-OTHER
This is needed to be compatible with JDK 21+ which does not allow other platforms (apart from the ones listed in the modules plugin) when linking a system image. Note the value of target platform doesn't matter to us, we just choose a closest one to replace "android". Bug: 313924276 Test: m EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN=true Change-Id: Id805f31089fdbd78bf4db06c89ae391f25563448
Diffstat (limited to 'java/system_modules.go')
-rw-r--r--java/system_modules.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/system_modules.go b/java/system_modules.go
index 0efa1a41c..359bee11f 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -55,7 +55,8 @@ var (
`${config.MergeZipsCmd} -j ${workDir}/module.jar ${workDir}/classes.jar $in && ` +
// Note: The version of the java.base module created must match the version
// of the jlink tool which consumes it.
- `${config.JmodCmd} create --module-version ${config.JlinkVersion} --target-platform android ` +
+ // Use LINUX-OTHER to be compatible with JDK 21+ (b/294137077)
+ `${config.JmodCmd} create --module-version ${config.JlinkVersion} --target-platform LINUX-OTHER ` +
` --class-path ${workDir}/module.jar ${workDir}/jmod/java.base.jmod && ` +
`${config.JlinkCmd} --module-path ${workDir}/jmod --add-modules java.base --output ${outDir} ` +
// Note: The system-modules jlink plugin is disabled because (a) it is not