install play-framework in Ubuntu 9.10

前端 未结 6 989
Happy的楠姐
Happy的楠姐 2021-02-05 19:28

I have copied zipped file from the playframework.org website and unzipped it at a location. I have inserted it in my .bashrc profile to set up as PATH environment.

But s

相关标签:
6条回答
  • 2021-02-05 19:53

    Suppose that the path of the play directory is /home/yourName/play

    open the terminal and type the following

    PATH=$PATH:/home/yourName/play
    export PATH
    

    then you will be able to access play command from anywhere

    0 讨论(0)
  • 2021-02-05 20:10

    Got the answer! Move the unzipped play folder into opt directory by typing

    sudo mv play-1.0.1 /opt/play
    

    and then give another command

    source /etc/profile
    

    And now one can run play command from anywhere in the shell..

    0 讨论(0)
  • 2021-02-05 20:12

    You also need to tell the terminal that "play" is a bash script. You will need to either rename play to play.sh, or run it with "bash play." Additionally the script needs to have executable permissions.

    I set it up with the following steps:

    • extract to ~/opt/play-2.1-RC1
    • mv ~/opt/play-2.1-RC1/play ~/opt/play-2.1-RC1/play.sh
    • chmod +x ~/opt/play-2.1-RC1/play.sh
    • alias play="/home/rob/opt/play-2.1-RC1/play.sh"

    Note that the alias can be run in a terminal, but to persist you will need to copy it to ~/.bashrc

    With this setup, local user can type play from any location.

    0 讨论(0)
  • 2021-02-05 20:12

    Try this command

    echo 'export PATH=/Applications/play-1.2.4:$PATH' >> ~/.profile

    0 讨论(0)
  • 2021-02-05 20:13
    source ~/.bashrc #would have done the trick probably
    
    0 讨论(0)
  • 2021-02-05 20:15

    Not to beat a dead horse but here's another way about it similar to the last post. Just ad an alias to your ~/.bashrc

    alias play="/home/usrName/javaApi/play-1.1/play"
    

    According to the .bashrc you could alternately add it to ~/.bash_aliases which seems to be best practice according to the comments in the file.

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