java-caller 4.1.0 → 4.1.1

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.
@@ -274,11 +274,8 @@ class JavaCaller {
274
274
 
275
275
  // Install appropriate java version using njre
276
276
  const njre = require("njre");
277
- const njreOptions = { type: javaTypeToInstall };
278
- const prevRequireMainFilename = require.main.filename; // hack require.main.filename to njre installs java where we want
279
- require.main.filename = packageJson;
277
+ const njreOptions = { type: javaTypeToInstall, installPath: packageJson };
280
278
  const installDir = await njre.install(javaVersionToInstall, njreOptions);
281
- require.main.filename = prevRequireMainFilename; // unhack require.main.filename
282
279
  console.log(`Installed Java ${javaTypeToInstall} ${javaVersionToInstall} in ${installDir}...`);
283
280
 
284
281
  // Call again this method: now matching java version will be found :)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "java-caller",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
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": [
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "debug": "^4.3.4",
39
39
  "fs-extra": "^11.1.1",
40
- "njre": "^1.2.1",
40
+ "njre": "^1.4.0",
41
41
  "semver": "^7.5.4"
42
42
  },
43
43
  "devDependencies": {