Skip to content

Commit 4158eb5

Browse files
committed
Switch JAVA_HOME to 21 for JRuby
JRuby 10 requires Java 21. Since the previous default was 17 and all JRuby releases should work fine on 21, we do this for all JRuby installs. Implements #718
1 parent bbda858 commit 4158eb5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

common.js

+4
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,7 @@ export function setupPath(newPathEntries) {
403403
core.addPath(newPath.join(path.delimiter))
404404
return msys2Type
405405
}
406+
407+
export function setupJavaHome() {
408+
core.exportVariable("JAVA_HOME", process.env[`JAVA_HOME_21_${os.arch().toUpperCase()}`]);
409+
}

ruby-builder.js

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export async function install(platform, engine, version) {
4949
// Set the PATH now, so the MSYS2 'tar' is in Path on Windows
5050
common.setupPath([path.join(rubyPrefix, 'bin')])
5151

52+
if (engine == "jruby") {
53+
common.setupJavaHome();
54+
}
55+
5256
if (!inToolCache) {
5357
await io.mkdirP(rubyPrefix)
5458
await downloadAndExtract(platform, engine, version, rubyPrefix)

0 commit comments

Comments
 (0)