mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 17:36:45 +00:00
Update Oracle JDK URL calculation
This commit is contained in:
parent
1f2faad7e0
commit
1a3cd386c6
2 changed files with 6 additions and 16 deletions
|
@ -65,15 +65,8 @@ export class OracleDistribution extends JavaBase {
|
|||
|
||||
const platform = this.getPlatform();
|
||||
const extension = getDownloadArchiveExtension();
|
||||
let major;
|
||||
let fileUrl;
|
||||
if (range.includes('.')) {
|
||||
major = range.split('.')[0];
|
||||
fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||
} else {
|
||||
major = range;
|
||||
fileUrl = `${ORACLE_DL_BASE}/${range}/latest/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||
}
|
||||
const major = range.includes('.') ? range.split('.')[0] : range;
|
||||
const fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||
|
||||
if (parseInt(major) < 17) {
|
||||
throw new Error('Oracle JDK is only supported for JDK 17 and later');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue