我正在使用android sdk bundle 64bit for linux os
这是我的java版本: -
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
运行以下命令,
java -jar selendroid-standalone-0.10.0-with-dependencies.jar
收到以下错误,
SEVERE: Error occurred while building server: io.selendroid.exceptions.ShellCommandException: An error occured while executing shell command: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /tmp/resigned-android-driver1919587484776084261.apk -storepass android -keystore /home/test/.android/debug.keystore /tmp/android-driver1919587484776084261.apk androiddebugkey
java.lang.RuntimeException: io.selendroid.exceptions.ShellCommandException: An error occured while executing shell command: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /tmp/resigned-android-driver1919587484776084261.apk -storepass android -keystore /home/test/.android/debug.keystore /tmp/android-driver1919587484776084261.apk androiddebugkey
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplicationsUnderTest(SelendroidStandaloneDriver.java:142)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(SelendroidStandaloneDriver.java:80)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidServer(SelendroidStandaloneServer.java:91)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStandaloneServer.java:65)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured while executing shell command: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /tmp/resigned-android-driver1919587484776084261.apk -storepass android -keystore /home/test/.android/debug.keystore /tmp/android-driver1919587484776084261.apk androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(SelendroidServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidServerBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplicationsUnderTest(SelendroidStandaloneDriver.java:138)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more
Exception in thread "main" java.lang.RuntimeException: io.selendroid.exceptions.ShellCommandException: An error occured while executing shell command: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /tmp/resigned-android-driver1919587484776084261.apk -storepass android -keystore /home/test/.android/debug.keystore /tmp/android-driver1919587484776084261.apk androiddebugkey
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplicationsUnderTest(SelendroidStandaloneDriver.java:142)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(SelendroidStandaloneDriver.java:80)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidServer(SelendroidStandaloneServer.java:91)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStandaloneServer.java:65)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured while executing shell command: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /tmp/resigned-android-driver1919587484776084261.apk -storepass android -keystore /home/test/.android/debug.keystore /tmp/android-driver1919587484776084261.apk androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(SelendroidServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidServerBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplicationsUnderTest(SelendroidStandaloneDriver.java:138)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more
我如何解决这个问题?
答案 0 :(得分:0)
我在linux中的.bashrc文件中设置了Java路径。然后这个错误就解决了。
以下是.bashrc文件中的行
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
PATH=$JAVA_HOME/bin:$PATH