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 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 14**
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:
@@ -214,7 +214,12 @@ class JavaCaller {
214
214
  if (await this.getInstallInCache()) {
215
215
  return;
216
216
  }
217
- const semverRule = `>=${this.minimumJavaVersion}.0.0` + (this.maximumJavaVersion ? ` <${this.maximumJavaVersion}.0.0` : '');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "java-caller",
3
- "version": "3.0.1-beta202311181906.0",
3
+ "version": "3.1.2-beta202311191629.0",
4
4
  "description": "Library to easily call java from node sources. Automatically installs java if not present",
5
5
  "main": "./lib/index.js",
6
6
  "files": [