-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
On my dedicated server build, I occasionally need to run multiple versions of Java at the same time. To run the latest version of java, this library does the job, but when I want to run java8 for modded servers, I need to specify where the java executible is.
I would suggest adding a executable option, with the default value of java to the javaserver config, and then implementing it in the start function.
Current
export class JavaServer extends EventsEmitter {
// ...
public start() {
if (this.process) {
throw new Error('JavaServer already running');
}
this.process = spawn('java', [...this.config.javaServer.args, '-jar', this.config.javaServer.jar, 'nogui'], {
cwd: this.config.javaServer.path,
stdio: ['pipe', 'pipe', 'pipe'],
});
//...
}
}Suggested
export class JavaServer extends EventsEmitter {
// ...
public start() {
if (this.process) {
throw new Error('JavaServer already running');
}
this.process = spawn(this.config.javaServer.executable, [...this.config.javaServer.args, '-jar', this.config.javaServer.jar, 'nogui'], {
cwd: this.config.javaServer.path,
stdio: ['pipe', 'pipe', 'pipe'],
});
//...
}
}Metadata
Metadata
Assignees
Labels
No labels