Configure Java Home
This commit is contained in:
		
							
								
								
									
										15
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								package.json
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
			
		||||
    "name": "frog",
 | 
			
		||||
    "displayName": "frog",
 | 
			
		||||
    "description": "The Oracle SQL workbench for VSCode",
 | 
			
		||||
    "version": "0.0.15",
 | 
			
		||||
    "version": "0.0.16",
 | 
			
		||||
    "publisher": "todie",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "vscode": "^1.17.0"
 | 
			
		||||
@@ -73,7 +73,18 @@
 | 
			
		||||
                "scopeName": "code.log",
 | 
			
		||||
                "path": "./syntaxes/frog-runner.tmLanguage"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
        ],
 | 
			
		||||
        "configuration": {
 | 
			
		||||
            "type": "object",
 | 
			
		||||
            "title": "Frog configuration",
 | 
			
		||||
            "properties": {
 | 
			
		||||
                "frog.javaHome": {
 | 
			
		||||
                    "type": "string",
 | 
			
		||||
                    "default": false,
 | 
			
		||||
                    "description": "Set the java home to use for the runner."
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    "scripts": {
 | 
			
		||||
        "vscode:prepublish": "npm run compile",
 | 
			
		||||
 
 | 
			
		||||
@@ -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 = "";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user