 # Dependencies
 {exec} = require 'child_process'
+os = require 'os'
+
+# Set platform defaults
+if os.platform() is 'win32'
+  which  = "where"
+else
+  which  = "which"
 
 module.exports = NslCore =
+  config:
+    pathToJar:
+      title: "Path To JAR"
+      description: "Specify the full path to `nsL.jar`"
+      type: "string"
+      default: ""
   subscriptions: null
-  which: null
-  prefix: null
 
   activate: (state) ->
     {CompositeDisposable} = require 'atom'

        exec "\"java\" -jar \"#{nslJar}\" \"#{script}\"", (error, stdout, stderr) ->
          if error isnt null
            # nslJar error from stdout, not error!
            atom.notifications.addError(script, detail: error, dismissable: true)
          else
            atom.notifications.addSuccess("Compiled successfully", detail: stdout, dismissable: false)
    else

      atom.beep()

  getPath: (callback) ->
    
    # Find Java
    exec "\"#{which}\" java", (error, stdout, stderr) ->
      if error isnt null
        atom.notifications.addError("**language-nsl**: Java is not in your `PATH` [environmental variable](http://superuser.com/a/284351/195953)", dismissable: true)
      else
        callback stdout
      return
