diff --git a/dist/index.js b/dist/index.js index 36a56bb7..aed138ad 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/src/installer.ts b/src/installer.ts index 7a8feaec..29b0d89a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -87,6 +87,10 @@ export async function getJava( } let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch; + // For portability reasons environment variables should only consist of + // uppercase letters, digits, and the underscore. Therefore we convert + // the extendedJavaHome variable to upper case and replace '.' symbols and + // any other non-alphanumeric characters with an underscore. extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_'); core.exportVariable('JAVA_HOME', toolPath); core.exportVariable(extendedJavaHome, toolPath);