diff --git a/src/distributions/base-installer.ts b/src/distributions/base-installer.ts index a07db43d..65e2f3b2 100644 --- a/src/distributions/base-installer.ts +++ b/src/distributions/base-installer.ts @@ -7,6 +7,7 @@ import * as httpm from '@actions/http-client'; import { getToolcachePath, isVersionSatisfies } from '../util'; import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from './base-models'; import { MACOS_JAVA_CONTENT_POSTFIX } from '../constants'; +import os from 'os'; export abstract class JavaBase { protected http: httpm.HttpClient; @@ -25,7 +26,7 @@ export abstract class JavaBase { ({ version: this.version, stable: this.stable } = this.normalizeVersion( installerOptions.version )); - this.architecture = installerOptions.architecture; + this.architecture = installerOptions.architecture || os.arch(); this.packageType = installerOptions.packageType; this.checkLatest = installerOptions.checkLatest; } diff --git a/src/setup-java.ts b/src/setup-java.ts index 6ec8efa5..8274be93 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -6,13 +6,12 @@ import { restore } from './cache'; import * as path from 'path'; import { getJavaDistribution } from './distributions/distribution-factory'; import { JavaInstallerOptions } from './distributions/base-models'; -import * as os from 'os'; async function run() { try { const version = core.getInput(constants.INPUT_JAVA_VERSION, { required: true }); const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, { required: true }); - const architecture = core.getInput(constants.INPUT_ARCHITECTURE) || os.arch(); + const architecture = core.getInput(constants.INPUT_ARCHITECTURE); const packageType = core.getInput(constants.INPUT_JAVA_PACKAGE); const jdkFile = core.getInput(constants.INPUT_JDK_FILE); const cache = core.getInput(constants.INPUT_CACHE);