简体   繁体   中英

Failed to start an Appium session.Error was: Error: 'java -version' failed

While running the application in Eclipse, I got error message as:

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: 'java -version' failed. Error: Command failed: Error: opening registry key 'Software\\JavaSoft\\Java Runtime Environment'
Error: could not find java.dll Error: Could not find Java SE Runtime Environment.

and in appium console it showing as Failed to start an Appium session, err was:

Error: 'java -version' failed. Error: Command failed: Error: opening registry key 'Software\\JavaSoft\\Java Runtime Environment'
Error: could not find java.dll Error: Could not find Java SE Runtime Environment.

I checked all the java path in system and looks its correct.

please check in your mission jdk, android and appium install or not for that use this commends.

use this commends go to cmd type:java---it will opened.after type android when ever your check the android at the time sdk manager will be opened if ur see the cmd one message has displayed the message is xcopy is missing which is available in system32 folder copy the link and set the path before the jdk it will works

Your JDK installation is broken, could be a lot of things:

  • Probably you have x64 JDK, but in your Windows\\System32 folder you have old java x32 java.exe, javaw.exe, javaws.exe, javap.exe and javac.exe You should delete them.

If not solved:

  • delete Software\\JavaSoft\\Java Runtime Environment keys from registry

In any case after these steps you will need to reinstall JDK

After research, I got solution for this issue. First uninstall all java in control panel and reinstall with latest version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM