• macOS 系统输入 appium-doctor后提示JAVA_HOME 环境变量未设置的解决办法


    【问题描述】

    在macOS 系统安装好 APPium之后,随即安装appium-doctor

    而后输入 appium-doctor,检查安装情况,提示:JAVA_HOME 环境变量未设置。

    如下所示:

      

     【解决办法】

       在macOS系统上设置环境变量:

        (参考博客: macOS系统 在~/.zshrc 中配置java环境变量: https://www.cnblogs.com/hf-cherish/p/5603147.html 

    1、首先检查一下 Java 是否安装

          

     2、根据以下提示输入命令:

        

     ## add the following line into the  .zshrc file :
    export JAVA_HOME=$(/usr/libexec/java_home)

         

     设置好了之后,输入 “ :wq” 退出。

          

    检查Java_home是否设置成功:

          

    输入的命令如下所示:

    ➜  ~ ## check all the available jdk
    ➜  ~ /usr/libexec/java_home -V
    Matching Java Virtual Machines (2):
        1.8.281.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
        1.8.0_201 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
    /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    ➜  ~ ## check the top jdk
    ➜  ~ /usr/libexec/java_home
    /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    ➜  ~ ## check some jdk
    ➜  ~ /usr/libexec/java_home -v 1.7
    /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    ➜  ~ ## edit .zshrc to set java_home variable
    ➜  ~ vim ~/.zshrc
    ➜  ~ ## Have opened .zshrc and added JAVE_HOME variable,now come back
    ➜  ~ ## Have opened .zshrc and added JAVE_HOME variable,now come back to here
    ➜  ~ ## let the configuration in .zshrc take effect
    ➜  ~ source ~/.zshrc
    npm WARN npm npm does not support Node.js v14.15.4
    npm WARN npm You should probably upgrade to a newer version of node as we
    npm WARN npm can't make any promises that npm will work with this version.
    npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
    npm WARN npm You can find the latest version at https://nodejs.org/
    nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
    Run `npm config delete prefix` or `nvm use --delete-prefix v8.11.4 --silent` to unset it.
    ➜  ~ ## check if configure succeed
    ➜  ~ echo $JAVA_HOME
    /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    ➜  ~ echo $ANDROID_HOME
    /Users/XXXX/Downloads/android-sdk-macosx
    ➜  ~

    最后是这样:(必须的“依赖”都已经安装完成)

        

  • 相关阅读:
    django 开发Broken pipe from ('127.0.0.1', 58078)问题解决
    cocos2d-js中jsc逆向为js攻略
    ECshop 怎样修改商品详细页的“浏览次数”
    ecshop 加广告出现广告位的宽度值必须在1到1024之间
    Nginx 301重定向的配置
    ECSHOP安装百度编辑UEditor教程
    Ecshop商品详情页显示当前会员等级价格
    ECSHOP始终显示全部分类方法
    vps主机修改系统远程端口号/添加防火墙
    ecshop利用.htaccess实现301重定向的方法
  • 原文地址:https://www.cnblogs.com/shenxiaolin/p/14383190.html
Copyright © 2020-2023  润新知