@@ -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