alcatraz / Alcatraz

Package manager for Xcode
alcatraz.io
MIT License
9.88k stars 1.15k forks source link

Command 'java -version' exited with code 2 #515

Closed LayneHuang closed 7 years ago

LayneHuang commented 7 years ago

LayneHuang:~ laynehuang$ appium-doctor info AppiumDoctor Appium Doctor v.1.4.2 info AppiumDoctor ### Diagnostic starting ### info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node info AppiumDoctor ✔ Node version is 6.10.2 info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer info AppiumDoctor ✔ Xcode Command Line Tools are installed. info AppiumDoctor ✔ DevToolsSecurity is enabled. info AppiumDoctor ✔ The Authorization DB is set up properly. info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage info AppiumDoctor ✔ HOME is set to: /Users/laynehuang info AppiumDoctor ✔ ANDROID_HOME is set to: /Users/laynehuang/Library/Android/sdk info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home info AppiumDoctor ✔ adb exists at: /Users/laynehuang/Library/Android/sdk/platform-tools/adb info AppiumDoctor ✔ android exists at: /Users/laynehuang/Library/Android/sdk/tools/android info AppiumDoctor ✔ emulator exists at: /Users/laynehuang/Library/Android/sdk/tools/emulator info AppiumDoctor ✔ Bin directory of $JAVA_HOME is set info AppiumDoctor ### Diagnostic completed, no fix needed. ### info AppiumDoctor info AppiumDoctor Everything looks good, bye! info AppiumDoctor

appium-doctor finish setting..

Appium Tips:

Xcode 8 isn't working? See https://github.com/alcatraz/Alcatraz/issues/475 [debug] [AndroidDriver] Getting Java version [debug] [AndroidDriver] Shutting down Android driver [debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active [MJSONWP] Encountered internal error running command: Error: Command 'java -version' exited with code 2 at ChildProcess. (../../lib/teen_process.js:70:19) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:886:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

here is my text code :

import os import unittest from appium import webdriver import time

PATH = lambda p: os.path.abspath( os.path.join(os.path.dirname(file), p) )

class DpAppTests(unittest.TestCase): def setUp(self): desired_caps = {} desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] = '4.4' desired_caps['deviceName'] = 'cca4da14' desired_caps['autoLaunch'] = 'true' desired_caps['app'] = PATH( 'apk/app-standard-debug.apk' ) desired_caps['appPackage'] = 'cc.sachsen.player.settings.debug' desired_caps['appActivity'] = '.AvatarDisplayActivity' self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

def tearDown(self):
    self.driver.quit() 

def test_dpApp(self): 
    time.sleep(15)
    el = self.driver.find_element_by_xpath("//android.widget.TextView[contains(@text,'拍照')]") 
    el.click() 

if name == 'main': suite = unittest.TestLoader().loadTestsFromTestCase(DpAppTests) unittest.TextTestRunner(verbosity=2).run(suite)

run it and traceback:

Traceback (most recent call last): File "sample1.py", line 30, in setUp self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 36, in init super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in init self.start_session(desired_capabilities, browser_profile) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 185, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 249, in execute self.error_handler.check_response(response) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Command 'java -version' exited with code 2

jurre commented 7 years ago

This doesn't seem to have anything to do with Alcatraz

JustinShiu commented 6 years ago

@LayneHuang I met the same problem on Appium's sample code. Do you find how to solve this problem?

jurre commented 6 years ago

What's Appium, and what does it have to do with Alcatraz?