Install Play! with activator on linux

2019-07-18 15:36发布

问题:

I'm new with the framework Play! and Linux and I'm trying to install Play! scala.

I'm following the official tutorial (official play! tutorial)

But I have this problem :

when I run this command : $ activator new my-first-app play-scala

I have this warning :

The program 'new' is currently not installed. You can install it by typing:
sudo apt-get install nmh

And when I run sudo apt-get install nmh It's said : nmh is already the newest version. (and I still have the same problem)

I also tried to run the activator UI, but I have an error as well :

Output key: !=unknown/error, -=none, 1=yes/on, 0=no/off

Am I doing something wrong?

Thank you in advance!

Edit : I had defined the PATH variable, but it has been canceled after that I closed the bash. It was the problem.

So I tried to define definitely the PATH variable with this command :

export PATH=$PATH

but it didn't work I also tried this :

echo "export PATH=$PATH:/home/sim/Bureau/Site/play-2.2.3/" >> /etc/bash.bashrc

The line has been written in the bash.bashrc file, but it still doesn't work. How can I define the PATH variable definitely?

回答1:

As stated in my comment, you'll want to add export PATH=$PATH:/full/path/to/activator/directory to your .bashrc file.



回答2:

Install Play framwork

I want to describe step by step activator installation in linux

  1. you had to install Java ( 6 or later )
  2. download activator's zip file from here
  3. extract the archive to a location where you have both read and write access. (Running activator writes some files to directories within the distribution, so don’t install to /opt, /usr/local or anywhere else you’d need special permission to write to.)

  4. add activator to you path

    1. in window's you must add /full/path/to/activator/directory to you environment variable. ( install play in a directory that doesn't include spaces (= not Program Files)).
    2. in Linux you must give a execution permission to activator ( with the command $ chmod +x /full/path/to/activator/directory/activator then you can either create bash script to run your activator or add it to your path ( add export PATH=$PATH:/full/path/to/activator/directory to your user's .bashrc ( you can find it in your user home directory ))
    3. in Mac OS you must give a execution permission to activator ( with the command $ chmod +x /full/path/to/activator/directory/activator then you can either create bash script to run your activator or add it to your path ( add export PATH=$PATH:/full/path/to/activator/directory to ~/.bashrc
  5. have fun ( this is a essential step don't forget )

create bash script

you can use this tutorial for learning bash script I wrote simple bash script that execute activator use it without warranty, either express or implied.I will be held liable for any damages caused or alleged to be caused directly or indirectly by this code. Here is my code link.



回答3:

Use below mentioned steps to install activator on CenOS6 or Amazon Linux machines

$ curl -LO https://downloads.typesafe.com/typesafe-activator/1.3.10/typesafe-activator-1.3.10.zip
$ unzip typesafe-activator-1.3.10.zip
$ sudo mv activator-dist-1.3.10 /opt
$ sudo ln -s /opt/activator-dist-1.3.10/bin/activator /usr/local/sbin/activator


回答4:

in Linux you must give a execution permission to activator ( with the command $ ./activator new (name)