java-caller 3.0.1-beta202311181906.0 → 3.1.2-beta202311191629.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/java-caller.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
Lightweight cross-platform javascript module to **easily call java commands from Node.js sources**.
|
|
16
16
|
|
|
17
17
|
- **Automatically installs required Java version** if not present on the system
|
|
18
|
-
- Compliant with **JDK & JRE** from **8 to
|
|
18
|
+
- Compliant with **JDK & JRE** from **8 to 20**
|
|
19
19
|
- Uses node [spawn](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) method to perform the call
|
|
20
20
|
|
|
21
21
|
There are two ways to use java-caller:
|
package/lib/java-caller.js
CHANGED
|
@@ -214,7 +214,12 @@ class JavaCaller {
|
|
|
214
214
|
if (await this.getInstallInCache()) {
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
let semverRule = ''
|
|
218
|
+
if (this.minimumJavaVersion === this.maximumJavaVersion) {
|
|
219
|
+
semverRule = `=${this.minimumJavaVersion}.x.x`;
|
|
220
|
+
} else {
|
|
221
|
+
semverRule = `>=${this.minimumJavaVersion}.0.0` + (this.maximumJavaVersion ? ` <=${this.maximumJavaVersion}.x.x` : '');
|
|
222
|
+
}
|
|
218
223
|
const javaVersion = await this.getJavaVersion();
|
|
219
224
|
const requiresInstall = javaVersion === false ? true : !semver.satisfies(javaVersion, semverRule)
|
|
220
225
|
if (requiresInstall) {
|
package/package.json
CHANGED