 
   getPath: (callback) ->
     if os.platform() is 'win32'
-      whichJava  = "where java"
+      whichCmd  = "where"
     else
-      whichJava  = "which java"
+      whichCmd  = "which"
 
     # Find Java
-    exec whichJava, (error, stdout, stderr) ->
-      if error isnt null
+    which = spawn whichCmd, ["java"]
+
+    which.stdout.on 'data', ( data ) ->
+      path = data.toString().trim()
+      return callback(path)
+
+    which.on 'close', ( errorCode ) ->
+      if errorCode > 0
         atom.notifications.addError("**#{meta.name}**: Java is not in your `PATH` [environmental variable](http://superuser.com/a/284351/195953)", dismissable: true)
-      else
-        callback stdout
-      return

      title: "Custom Arguments"
      description: "Specify your preferred arguments for nsL Assembler"
      type: "string"
      default: "/nomake"
      order: 1
  subscriptions: null



        exec nslCmd, (error, stdout, stderr) ->
          if error or stderr
            detail = unless stderr then error else stderr
            atom.notifications.addError("Transpile failed", detail: stderr, dismissable: true)

            return

