From bb3d7f35619b902c530b34ab12c39894d443358c Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Mon, 1 Apr 2024 15:48:39 -0400 Subject: [PATCH] Partial fix for #595 - Add explicit check for java binary Signed-off-by: Rob Stryker --- src/impl/requirements.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/impl/requirements.ts b/src/impl/requirements.ts index bc86d296..82bb1036 100644 --- a/src/impl/requirements.ts +++ b/src/impl/requirements.ts @@ -101,6 +101,9 @@ async function checkJavaRuntime(): Promise { if (!pathExists.sync(javaHome)) { return getRejectionWithDownloadUrl(`${source} points to a missing folder`); } + if (!pathExists.sync(path.resolve(javaHome, 'bin', JAVA_FILENAME))) { + return getRejectionWithDownloadUrl(`${source} does not point to a JDK. The '${JAVA_FILENAME}' command is missing.`); + } if (!pathExists.sync(path.resolve(javaHome, 'bin', JAVAC_FILENAME))) { return getRejectionWithDownloadUrl(`${source} does not point to a JDK. The '${JAVAC_FILENAME}' command is missing.`); }