Linux JAVA in path but permissions denied

前端 未结 3 908
慢半拍i
慢半拍i 2021-02-09 04:51

Im trying to get JAVA enabled on Intel Edison which uses Yocto (Linux), the problem is that after extracting the zip, im able to check the version, and when putting it into the

3条回答
  •  孤街浪徒
    2021-02-09 05:32

    root's home folder is not under "/home". Change this

    /home/root/java/jdk1.7.0_67/bin:/home/root/java/jdk1.7.0_67/bin
    

    to

    /root/java/jdk1.7.0_67/bin
    

    Also,

    /home/root/bin
    

    should probably be

    /root/bin
    

    For similar reasons. When writing a script you can use $HOME which will expand to wherever the user's home directory happens to be. So,

    PATH="$HOME/bin:$HOME/java/jdk1.7.0_67/bin"
    

    Edit

    I would not recommend that you link to java in $HOME/bin. Let's set a JAVA_HOME and move that to the front of the PATH like

    export JAVA_HOME=$HOME/java/jdk1.7.0_67
    export PATH="$JAVA_HOME/bin:$HOME/bin:$PATH"
    

提交回复
热议问题