[转载]
Last login: Thu Mar 30 10:35:19 on ttys000
/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/uiautomatorviewer ; exit;
~ /Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/uiautomatorviewer ; exit;
-Djava.ext.dirs=/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/lib/x86_64:/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/lib is not supported. Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Saving session...completed.
[进程已完成]
解决方案
jdk版本不匹配,回退版本至8,详细如下
1.下载jdk1.8版本,并安装
下载地址:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html
2.进入sdk/tools目录,vi runuiautomatorviewer.sh
#runuiautomatorviewer.sh
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
export JAVA_BIN=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin
export PATH=$JAVA_BIN:$JAVA_HOME:$PATH
./uiautomatorviewer
3.运行bash runuiautomatorviewer.sh
即可正常启动uiautomatorviewer
工具
网友评论