zoukankan      html  css  js  c++  java
  • 【Mac】-NO.161.Mac.1 -【MacOS 中环境变量设置 zsh: command not found: xxx】

    Style:Mac

    Series:Java

    Since:2018-09-10

    End:2018-09-10

    Total Hours:1

    Degree Of Diffculty:5

    Degree Of Mastery:5

    Practical Level:5

    Desired Goal:5

    Archieve Goal:3

    Gerneral Evaluation:3

    Writer:kingdelee

    Related Links:

    http://www.cnblogs.com/kingdelee/

    1.当安装了zsh与linux不同

    单纯的使用这个方法 vim ~/.bash_profile,

    export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
    export JAVA_10_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
    export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    
    export GRADLE_HOME=$/Users/kingdelee/Library/gradle/gradle-4.10.2
    export GRADLE_USER_HOME=/Users/kingdelee/workstation/gradle/.gradle
    export MAVEN_HOME=/Users/kingdelee/Library/Maven/apache-maven-3.5.4
    
    
    alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
    alias jdk10="export JAVA_HOME=$JAVA_10_HOME"
    alias jdk11="export JAVA_HOME=$JAVA_11_HOME"
    
    export JAVA_HOME=$JAVA_11_HOME
    
    PATH="${PATH}:${JAVA_HOME}:${GRADLE_HOME}/bin:${MAVEN_HOME}/bin"
    export PATH
    

      

    再执行source ~/.bash_profile ,新建标签的时候,新标签仍旧无法生效

    必须要 open ~/.zshrc,然后再文档末尾追加

    source ~/.bash_profile 
    

    这样执行source ~/.zshrc,新开标签也可以了。

    然并卵,还是得在 ~/.zshrc 后面追加 具体的环境变量设置,即把/.bash_profile的那些拷贝到zshrc里边

      

     vim ~/.zshrc

    source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    source ~/.bash_profile 
    source /etc/profile
    
    #export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
    #export JAVA_10_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
    #export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    
    #export GRADLE_HOME=$/Users/kingdelee/Library/gradle/gradle-4.10.2
    #export GRADLE_USER_HOME=/Users/kingdelee/workstation/gradle/.gradle
    #export MAVEN_HOME=/Users/kingdelee/soft/maven/maven-3.6.0
    
    #alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
    #alias jdk10="export JAVA_HOME=$JAVA_10_HOME"
    #alias jdk11="export JAVA_HOME=$JAVA_11_HOME"
    
    #alias mysql="/usr/local/mysql/bin/mysql"
    #alias mysqladmin="/usr/local/mysql/bin/mysqladmin"
    
    #export JAVA_HOME=$JAVA_11_HOME
    
    PATH="${PATH}:${JAVA_HOME}:${GRADLE_HOME}/bin:${MAVEN_HOME}/bin"
    export PATH
    

      

  • 相关阅读:
    idea常用快捷键及操作
    Ubuntu 装nexus
    ubuntu安装gitlab
    ubuntu安装jdk,maven,tomcat
    ubuntu安装gitlab-ci-runner、注册
    ubuntu开启远程shell,开启上传下载
    Ubuntu安装软件提示boot空间不足
    POJ3461 KMP简单变形输出模式串在主串出现的次数
    涨姿势stl map['a']['a']=b;
    对链表的操作(数据结构线性表算法设计练习)
  • 原文地址:https://www.cnblogs.com/kingdelee/p/9885909.html
Copyright © 2011-2022 走看看