简体   繁体   English

如何在 java 11 中运行 uiautomatorviewer?

[英]How to run uiautomatorviewer in java 11?

C:\Users\Shruti>uiautomatorviewer -Djava.ext.dirs=C:\Program Files\Java\jdk-11.0.14\lib;..\lib is not supported. C:\Users\Shruti>uiautomatorviewer -Djava.ext.dirs=C:\Program Files\Java\jdk-11.0.14\lib;..\lib 不受支持。 Use -classpath instead.请改用 -classpath。 Error: Could not create the Java Virtual Machine.错误:无法创建 Java 虚拟机。 Error: A fatal exception has occurred.错误:发生了致命异常。 Program will exit.程序将会退出。

First I had java 15 but I heard java 8 is compatible for uiautomatorviewer but it didn't helped then I uprgaded it to java 11 but same issue plz help首先我有 java 15 但我听说 java 8 与 uiautomatorviewer 兼容但它没有帮助然后我将它升级到 Z93F725A07423FE1C889F4118B33 D pl21z46

I couldn't make it work with Java 11 and I doubt it's possible to as there may be substantial differences in the APIs used, but I was able to run it using Java 8 while maintaining Java 11 as the default java. I couldn't make it work with Java 11 and I doubt it's possible to as there may be substantial differences in the APIs used, but I was able to run it using Java 8 while maintaining Java 11 as the default java. Simply open <android-sdk>/tools/bin/uiautomatorviewer with a text editor and replace只需使用文本编辑器打开<android-sdk>/tools/bin/uiautomatorviewer并替换

javaCmd="java"

with

javaCmd="/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java"

(or whatever your path to java 8 bin is located) (或任何通往 java 8 bin 的路径)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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