scala 安装播放!在 linux 上使用激活器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24100007/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 06:19:12  来源:igfitidea点击:

Install Play! with activator on linux

linuxscalaplayframeworkinstallation

提问by Simon

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

我是 Play 框架的新手!和 Linux,我正在尝试安装 Play!斯卡拉。

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

当我运行此命令时: $ 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 nmhIt's said : nmh is already the newest version. (and I still have the same problem)

当我运行时sudo apt-get install nmh有人说:(nmh is already the newest version. 我仍然有同样的问题)

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

我也尝试运行激活器 UI,但我也有一个错误:

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.

编辑:我已经定义了 PATH 变量,但是在我关闭 bash 之后它被取消了。这就是问题所在。

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

所以我试图用这个命令明确定义 PATH 变量:

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?

该行已写入 bash.bashrc 文件中,但仍然无法正常工作。如何确定地定义 PATH 变量?

回答by Michael Zajac

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

正如我的评论中所述,您需要添加export PATH=$PATH:/full/path/to/activator/directory到您的.bashrc文件中。

回答by Esterlinkof

Install Play framwork

安装 Play 框架

I want to describe step by step activator installation in linux

我想一步一步描述在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/activatorthen you can either create bash script to run your activator or add it to your path ( add export PATH=$PATH:/full/path/to/activator/directoryto 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/activatorthen you can either create bash script to run your activator or add it to your path ( add export PATH=$PATH:/full/path/to/activator/directoryto ~/.bashrc
  5. have fun ( this is a essential step don't forget )
  1. 您必须安装 Java(6 或更高版本)
  2. 这里下载激活器的 zip 文件
  3. 将存档解压缩到您具有读写访问权限的位置。(运行 activator 会将一些文件写入发行版中的目录,所以不要安装到 /opt、/usr/local 或其他任何您需要特殊权限才能写入的地方。)

  4. 将激活器添加到您的路径

    1. 在窗口中,您必须将 /full/path/to/activator/directory 添加到您的环境变量中。(在不包含空格(= 不是程序文件)的目录中安装 play)。
    2. 在 Linux 中,您必须授予激活器的执行权限(使用该命令,$ chmod +x /full/path/to/activator/directory/activator您可以创建 bash 脚本来运行您的激活器或将其添加到您的路径中(添加export PATH=$PATH:/full/path/to/activator/directory到您的用户的.bashrc(您可以在您的用户主目录中找到它))
    3. 在 Mac OS 中,您必须授予激活器的执行权限(使用该命令,$ chmod +x /full/path/to/activator/directory/activator您可以创建 bash 脚本来运行激活器或将其添加到您的路径中(添加export PATH=$PATH:/full/path/to/activator/directory~/.bashrc
  5. 玩得开心(这是必不可少的一步,不要忘记)

create bash script

创建 bash 脚本

you can use thistutorial 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. Hereis my code link.

您可以使用教程来学习 bash 脚本 我编写了执行激活器的简单 bash 脚本 使用它没有任何明示或暗示的保证。对于由此代码直接或间接造成或声称造成的任何损害,我将承担责任。是我的代码链接。

回答by Gaurav Padgilwar

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

使用下面提到的步骤在 CenOS6 或 Amazon Linux 机器上安装激活器

$ 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

回答by Rakesh

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

在 Linux 中,您必须授予激活器执行权限(使用命令 $ ./activator new (name)