From 82b441d0f76d187818759eb9166408d54709277e Mon Sep 17 00:00:00 2001 From: MelonCode Date: Tue, 2 Apr 2019 02:58:47 +0300 Subject: [PATCH] Added option to specify JRE executable file --- README.md | 1 + components/launcher.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f2ae84e..161b8c3 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ launcher.authenticator.getAuth("email", "password").then(auth => { | `options.clientPackage` | String | Path to the client package zip file. | False | | `options.root` | String | Path where you want the launcher to work in. like `C:/Users/user/AppData/Roaming/.mc` | True | | `options.os` | String | windows, osx or linux | True | +| `options.javaPath` | String | Path to the JRE executable file, will default to `java` if not entered. | False | | `options.version.number` | String | Minecraft version that is going to be launched. | True | | `options.version.type` | String | Any string. The actual Minecraft launcher uses `release` and `snapshot`. | True | | `options.memory.max` | String | Max amount of memory being used by Minectaft | True | diff --git a/components/launcher.js b/components/launcher.js index a55ae6e..711b38b 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -61,7 +61,7 @@ module.exports = async function (options) { const launchArguments = args.concat(jvm, classPaths, launchOptions); - const minecraft = child.spawn(`java`, launchArguments); + const minecraft = child.spawn(options.javaPath ? options.javaPath : 'java', launchArguments); event.emit('start', null); minecraft.stdout.on('data', (data) => event.emit('data', data)); minecraft.stderr.on('data', (data) => event.emit('error', data));