mac 配置Java环境变量,环境变量已配置但不是有效路径!
JAVA_HOME is set to ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/’ but this is NOT a valid path!
此时应该去查看你java的安装路径,当前是安装到:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home中了,其实Java环境需要安装在:/Users/
xz
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home中(标红色的”xz“是电脑本机的用户名!)
那么现在该怎么办呢?
解决办法:把/Library/Java/JavaVirtualMachines中的整个java文件拷贝到/Users/liepin/Library/Java/JavaVirtualMachines下。然后再把环境变量改成最新的位置就可以了。
ps:我是用mac配置appium环境时用到的,当时记录了下。现在把问题及解决办法存在这里
原问题原因,appium-doctor检查时报问题:
WARN AppiumDoctor ✖ JAVA_HOME is set to ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/’ but this is NOT a valid path!大坑大坑!jdk安装路径问题。。。。。。……