Skip to content

Commit c3ac5dd

Browse files
Revert "Add support for Oracle JDK (#401)" (#421)
This reverts commit 6cdf39a. Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
1 parent dcd29da commit c3ac5dd

File tree

9 files changed

+2
-359
lines changed

9 files changed

+2
-359
lines changed

.github/workflows/e2e-versions.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ jobs:
2525
exclude:
2626
- distribution: microsoft
2727
version: 8
28-
include:
29-
- distribution: oracle
30-
os: macos-latest
31-
version: 17
32-
- distribution: oracle
33-
os: windows-latest
34-
version: 19
35-
- distribution: oracle
36-
os: ubuntu-latest
37-
version: 19
3828
steps:
3929
- name: Checkout
4030
uses: actions/checkout@v3
@@ -61,10 +51,6 @@ jobs:
6151
- '11.0'
6252
- '8.0.302'
6353
- '16.0.2+7'
64-
include:
65-
- distribution: oracle
66-
os: ubuntu-latest
67-
version: '19.0.1'
6854
steps:
6955
- name: Checkout
7056
uses: actions/checkout@v3

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ Currently, the following distributions are supported:
9999
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
100100
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
101101
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
102-
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
103102

104103
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
105104

__tests__/distributors/oracle-installer.test.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.

__tests__/verify-java.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424
ACTUAL_JAVA_VERSION="$(java -version 2>&1)"
2525
echo "Found java version: $ACTUAL_JAVA_VERSION"
2626

27-
GREP_RESULT=$(echo $ACTUAL_JAVA_VERSION | grep -E "^(openjdk|java) version \"$EXPECTED_JAVA_VERSION")
27+
GREP_RESULT=$(echo $ACTUAL_JAVA_VERSION | grep "^openjdk version \"$EXPECTED_JAVA_VERSION")
2828
if [ -z "$GREP_RESULT" ]; then
2929
echo "::error::Unexpected version"
3030
echo "Expected version: $EXPECTED_JAVA_VERSION"

dist/setup/index.js

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -104157,7 +104157,6 @@ const installer_4 = __nccwpck_require__(8579);
104157104157
const installer_5 = __nccwpck_require__(883);
104158104158
const installer_6 = __nccwpck_require__(3613);
104159104159
const installer_7 = __nccwpck_require__(4750);
104160-
const installer_8 = __nccwpck_require__(4298);
104161104160
var JavaDistribution;
104162104161
(function (JavaDistribution) {
104163104162
JavaDistribution["Adopt"] = "adopt";
@@ -104169,7 +104168,6 @@ var JavaDistribution;
104169104168
JavaDistribution["JdkFile"] = "jdkfile";
104170104169
JavaDistribution["Microsoft"] = "microsoft";
104171104170
JavaDistribution["Corretto"] = "corretto";
104172-
JavaDistribution["Oracle"] = "oracle";
104173104171
})(JavaDistribution || (JavaDistribution = {}));
104174104172
function getJavaDistribution(distributionName, installerOptions, jdkFile) {
104175104173
switch (distributionName) {
@@ -104190,8 +104188,6 @@ function getJavaDistribution(distributionName, installerOptions, jdkFile) {
104190104188
return new installer_6.MicrosoftDistributions(installerOptions);
104191104189
case JavaDistribution.Corretto:
104192104190
return new installer_7.CorrettoDistribution(installerOptions);
104193-
case JavaDistribution.Oracle:
104194-
return new installer_8.OracleDistribution(installerOptions);
104195104191
default:
104196104192
return null;
104197104193
}
@@ -104599,125 +104595,6 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
104599104595
exports.MicrosoftDistributions = MicrosoftDistributions;
104600104596

104601104597

104602-
/***/ }),
104603-
104604-
/***/ 4298:
104605-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
104606-
104607-
"use strict";
104608-
104609-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
104610-
if (k2 === undefined) k2 = k;
104611-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
104612-
}) : (function(o, m, k, k2) {
104613-
if (k2 === undefined) k2 = k;
104614-
o[k2] = m[k];
104615-
}));
104616-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
104617-
Object.defineProperty(o, "default", { enumerable: true, value: v });
104618-
}) : function(o, v) {
104619-
o["default"] = v;
104620-
});
104621-
var __importStar = (this && this.__importStar) || function (mod) {
104622-
if (mod && mod.__esModule) return mod;
104623-
var result = {};
104624-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
104625-
__setModuleDefault(result, mod);
104626-
return result;
104627-
};
104628-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
104629-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
104630-
return new (P || (P = Promise))(function (resolve, reject) {
104631-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
104632-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
104633-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
104634-
step((generator = generator.apply(thisArg, _arguments || [])).next());
104635-
});
104636-
};
104637-
var __importDefault = (this && this.__importDefault) || function (mod) {
104638-
return (mod && mod.__esModule) ? mod : { "default": mod };
104639-
};
104640-
Object.defineProperty(exports, "__esModule", ({ value: true }));
104641-
exports.OracleDistribution = void 0;
104642-
const core = __importStar(__nccwpck_require__(2186));
104643-
const tc = __importStar(__nccwpck_require__(7784));
104644-
const fs_1 = __importDefault(__nccwpck_require__(7147));
104645-
const path_1 = __importDefault(__nccwpck_require__(1017));
104646-
const base_installer_1 = __nccwpck_require__(9741);
104647-
const util_1 = __nccwpck_require__(2629);
104648-
const http_client_1 = __nccwpck_require__(9925);
104649-
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
104650-
class OracleDistribution extends base_installer_1.JavaBase {
104651-
constructor(installerOptions) {
104652-
super('Oracle', installerOptions);
104653-
}
104654-
downloadTool(javaRelease) {
104655-
return __awaiter(this, void 0, void 0, function* () {
104656-
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
104657-
const javaArchivePath = yield tc.downloadTool(javaRelease.url);
104658-
core.info(`Extracting Java archive...`);
104659-
let extension = util_1.getDownloadArchiveExtension();
104660-
let extractedJavaPath = yield util_1.extractJdkFile(javaArchivePath, extension);
104661-
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
104662-
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
104663-
const version = this.getToolcacheVersionName(javaRelease.version);
104664-
let javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
104665-
return { version: javaRelease.version, path: javaPath };
104666-
});
104667-
}
104668-
findPackageForDownload(range) {
104669-
return __awaiter(this, void 0, void 0, function* () {
104670-
const arch = this.distributionArchitecture();
104671-
if (arch !== 'x64' && arch !== 'aarch64') {
104672-
throw new Error(`Unsupported architecture: ${this.architecture}`);
104673-
}
104674-
if (!this.stable) {
104675-
throw new Error('Early access versions are not supported');
104676-
}
104677-
if (this.packageType !== 'jdk') {
104678-
throw new Error('Oracle JDK provides only the `jdk` package type');
104679-
}
104680-
const platform = this.getPlatform();
104681-
const extension = util_1.getDownloadArchiveExtension();
104682-
let major;
104683-
let fileUrl;
104684-
if (range.includes('.')) {
104685-
major = range.split('.')[0];
104686-
fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
104687-
}
104688-
else {
104689-
major = range;
104690-
fileUrl = `${ORACLE_DL_BASE}/${range}/latest/jdk-${range}_${platform}-${arch}_bin.${extension}`;
104691-
}
104692-
if (parseInt(major) < 17) {
104693-
throw new Error('Oracle JDK is only supported for JDK 17 and later');
104694-
}
104695-
const response = yield this.http.head(fileUrl);
104696-
if (response.message.statusCode === http_client_1.HttpCodes.NotFound) {
104697-
throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
104698-
}
104699-
if (response.message.statusCode !== http_client_1.HttpCodes.OK) {
104700-
throw new Error(`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`);
104701-
}
104702-
return { url: fileUrl, version: range };
104703-
});
104704-
}
104705-
getPlatform(platform = process.platform) {
104706-
switch (platform) {
104707-
case 'darwin':
104708-
return 'macos';
104709-
case 'win32':
104710-
return 'windows';
104711-
case 'linux':
104712-
return 'linux';
104713-
default:
104714-
throw new Error(`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`);
104715-
}
104716-
}
104717-
}
104718-
exports.OracleDistribution = OracleDistribution;
104719-
104720-
104721104598
/***/ }),
104722104599

104723104600
/***/ 8579:

docs/advanced-usage.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- [Liberica](#Liberica)
77
- [Microsoft](#Microsoft)
88
- [Amazon Corretto](#Amazon-Corretto)
9-
- [Oracle](#Oracle)
109
- [Installing custom Java package type](#Installing-custom-Java-package-type)
1110
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
1211
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
@@ -110,19 +109,6 @@ steps:
110109
- run: java -cp java HelloWorldApp
111110
```
112111

113-
### Oracle
114-
**NOTE:** Oracle Java SE Development Kit is only available for version 17 and later.
115-
116-
```yaml
117-
steps:
118-
- uses: actions/checkout@v3
119-
- uses: actions/setup-java@v3
120-
with:
121-
distribution: 'oracle'
122-
java-version: '17'
123-
- run: java -cp java HelloWorldApp
124-
```
125-
126112
## Installing custom Java package type
127113
```yaml
128114
steps:

src/distributions/distribution-factory.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { TemurinDistribution, TemurinImplementation } from './temurin/installer'
77
import { LibericaDistributions } from './liberica/installer';
88
import { MicrosoftDistributions } from './microsoft/installer';
99
import { CorrettoDistribution } from './corretto/installer';
10-
import { OracleDistribution } from './oracle/installer';
1110

1211
enum JavaDistribution {
1312
Adopt = 'adopt',
@@ -18,8 +17,7 @@ enum JavaDistribution {
1817
Liberica = 'liberica',
1918
JdkFile = 'jdkfile',
2019
Microsoft = 'microsoft',
21-
Corretto = 'corretto',
22-
Oracle = 'oracle'
20+
Corretto = 'corretto'
2321
}
2422

2523
export function getJavaDistribution(
@@ -45,8 +43,6 @@ export function getJavaDistribution(
4543
return new MicrosoftDistributions(installerOptions);
4644
case JavaDistribution.Corretto:
4745
return new CorrettoDistribution(installerOptions);
48-
case JavaDistribution.Oracle:
49-
return new OracleDistribution(installerOptions);
5046
default:
5147
return null;
5248
}

0 commit comments

Comments
 (0)