Skip to content

Commit 73f3456

Browse files
authored
Merge pull request #294 from Achal1607/javavscode-291
Fixed JDK Downloader windows ARM64 download issue
2 parents c383a6e + 97fd798 commit 73f3456

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

vscode/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const ORACLE_JDK_BASE_DOWNLOAD_URL = `https://download.oracle.com/java`;
2222
export const ORACLE_JDK_DOWNLOAD_VERSIONS = ['23','21'];
2323

2424
export const OPEN_JDK_VERSION_DOWNLOAD_LINKS: { [key: string]: string } = {
25-
"23": "https://download.java.net/java/GA/jdk23/3c5b90190c68498b986a97f276efd28a/37/GPL/openjdk-23"
25+
"23": "https://download.java.net/java/GA/jdk23.0.1/c28985cbf10d4e648e4004050f8781aa/11/GPL/openjdk-23.0.1"
2626
};
2727

2828
export const ORACLE_VSCODE_EXTENSION_ID = 'oracle.oracle-java';

vscode/src/jdkDownloader/view.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,12 @@ export class JdkDownloaderView {
201201
}
202202

203203
private getMachineArchHtml = () => {
204-
return `<option value="aarch64" ${this.machineArch === 'aarch64' ? 'selected' : null}>arm64</option>
205-
<option value="x64" ${this.machineArch === 'x64' ? 'selected' : null}>x64</option>`
204+
if (this.osType === 'windows') {
205+
return `<option value="x64" selected>x64</option>`;
206+
} else {
207+
return `<option value="aarch64" ${this.machineArch === 'aarch64' ? 'selected' : null}>arm64</option>
208+
<option value="x64" ${this.machineArch === 'x64' ? 'selected' : null}>x64</option>`;
209+
}
206210
}
207211

208212
private getScriptJs = () => {
@@ -234,6 +238,28 @@ export class JdkDownloaderView {
234238
triggerJDKDownload(event);
235239
});
236240
241+
document.getElementById("oracleJDKOsTypeDropdown")?.addEventListener('change', (event) => {
242+
updateMachineArchOptions(event.target.id);
243+
});
244+
245+
document.getElementById("openJDKOsTypeDropdown")?.addEventListener('change', (event) => {
246+
updateMachineArchOptions(event.target.id);
247+
});
248+
249+
const updateMachineArchOptions = (osDropdownId) => {
250+
const osDropdown = document.getElementById(osDropdownId);
251+
const machineArchDropdown = document.getElementById(osDropdownId.replace('OsTypeDropdown', 'MachineArchDropdown'));
252+
253+
if (osDropdown.value === 'windows') {
254+
machineArchDropdown.innerHTML = '<option value="x64" selected>x64</option>';
255+
} else {
256+
machineArchDropdown.innerHTML = \`
257+
<option value="aarch64" \${machineArchDropdown.value === 'aarch64' ? 'selected' : null}>arm64</option>
258+
<option value="x64" \${machineArchDropdown.value === 'x64' ? 'selected' : null}>x64</option>
259+
\`;
260+
}
261+
};
262+
237263
const hideOrDisplayDivs = (e) => {
238264
const { id } = e.target;
239265
if(activeButton){

0 commit comments

Comments
 (0)