Command 'java -version' exited with error code 20


#1

I keep getting a error code 20 when trying to launch my app on my real device in inspector mode. Any ideas?

My Capabilities:
“deviceName”: "Android ",
“app”: “/Users/lavelljackson/Desktop/Automation/Son.apk”,
“newCommandTImeout”: 5000,
“platformName”: “Android”

LOGS
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {“app”:"/Users/lavelljackso…
[warn] [BaseDriver] The following capabilities were provided, but are not recognized by appium: newCommandTImeout, connectHardwareKeyboard.
[info] [BaseDriver] Session created with session id: dfab371e-9075-495a-832c-bb1cbb297460[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1541433533607 (09:58:53 GMT-0600 (CST))
[debug] [MJSONWP] Encountered internal error running command: Error: Command ‘java -version’ exited with code 20
[debug] [MJSONWP] at ChildProcess. (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/teen_process/lib/exec.js:94:19)
[debug] [MJSONWP] at emitTwo (events.js:126:13)
[debug] [MJSONWP] at ChildProcess.emit (events.js:214:7)
[debug] [MJSONWP] at maybeClose (internal/child_process.js:925:16)
[debug] [MJSONWP] at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
[info] [HTTP] <-- POST /wd/hub/session 500 54 ms - 180
[info] [HTTP]
[info] [HTTP] --> DELETE /wd/hub/session
[info] [HTTP] {}
[debug] [HTTP] No route found. Setting content type to ‘text/plain’
[info] [HTTP] <-- DELETE /wd/hub/session 404 1 ms - 57
[info] [HTTP]

Terminal:
Lavells-MacBook-Air:~ lavelljackson$ java -version
Unable to locate an executable at “/usr/bin/java/bin/java” (-1)

New Error
debug] [MJSONWP] Encountered internal error running command: Error: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘/Users/lavelljackson/Library/Android/sdk/platform-tools/adb -P 5037 -s 6b58dac3 shell getprop ro.build.version.sdk’ exited with code 1’; Stderr: 'error: device unauthorized.

Found the Solution:

Had to redo my JAVA_HOME