Configure Java Home

This commit is contained in:
Thorsten Muerell
2017-11-08 15:36:51 +01:00
parent 1e66025b23
commit 2267d86f03
2 changed files with 20 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
import { ConnectionNode } from './connections'
import { spawn } from 'child_process'
import { TextDocumentContentProvider } from './resultsetview'
import * as path from 'path'
const extensionName = "frog";
const previewUri = vscode.Uri.parse('frog-view://authority/resultset');
@@ -59,7 +60,12 @@ export class SessionManager {
}
let extPath = vscode.extensions.getExtension("todie.frog").extensionPath;
this.dbSession = spawn("java", ['-jar', extPath + '/frog-runner.jar', this.currentConnection.host, this.currentConnection.port.toString(), this.currentConnection.schema, this.currentConnection.username, this.currentConnection.password]);
let javaHome = vscode.workspace.getConfiguration('frog').get("frog.javaHome", "")
let java = "java";
if (javaHome) {
java = path.join(javaHome, 'bin', 'java')
}
this.dbSession = spawn(java, ['-jar', extPath + '/frog-runner.jar', this.currentConnection.host, this.currentConnection.port.toString(), this.currentConnection.schema, this.currentConnection.username, this.currentConnection.password]);
let outputBuffer = "";