Linux JAVA in path but permissions denied

前端 未结 3 906
慢半拍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"
    
    0 讨论(0)
  • 2021-02-09 05:41
    sudo chmod a+x /usr/bin/java
    sudo chmod a+x /usr/bin/javac
    sudo chmod a+x /usr/bin/javaws
    sudo chown -R root:root /usr/lib/jvm/jdk1.8.0
    
    0 讨论(0)
  • 2021-02-09 05:55

    You need to be logged in as Root

    . .profile
    

    If that doesn't work you can source your file.

    source .profile 
    

    note that source is a synonym of '.' (period).

    0 讨论(0)
提交回复
热议问题