Search code examples
angularjsintellij-ideaplayframework

Play Application Couldn't be Started


Recently I've been assigned for a project created with AngularJs and it uses Java Play framework to run it. I use IntelliJ-Idea IDE for the development and to run this application.

Once I clicked on "Run", it gives me following errors in the console.

'force' enabled
Will run: [gulp, --gulpfile=gulpfile.js, watch, --force] in /home/supuns/Projects/bd-business-portal/ui
java.io.IOException: Cannot run program "gulp" (in directory "/home/supuns/Projects/bd-business-portal/ui"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
[error] (compile:run) java.io.IOException: Cannot run program "gulp" (in directory "/home/supuns/Projects/bd-business-portal/ui"): error=2, No such file or directory
[error] Total time: 2 s, completed Oct 24, 2016 10:54:25 AM

Process finished with exit code 1

I can't figure out what is happening because I'm new to the environment.

UPDATE: Sorry about the less information I have given in my question. I have globally installed gulp but still it is not working.

Here's the content of build.sbt file.

name := """bd-business-portal"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs
)

Solution

  • With the help of my team members I have found the reason that cause this issue is IntelliJ-Idea doesn't know the path to 'Gulp'. I'm using Ubuntu 16.04 and even though I have set the path globally it doesn't understand where to find gulp.

    Therefore I have installed sbt and from the IntelliJ terminal ran the command:

    sbt run
    

    and it worked.

    Update

    As I had to work on multiple Play framework sbt projects, doing "sbt run" on the terminal and closing IntelliJ windows to free the port was bit hectic. Therefore I decided to find the actual path variable that created this behavior and I found the PATH variable saved in /etc/environment was "/home/supuns/.nvm/versions/node/v6.9.1/bin/gulp" and I changed it to

    /home/supuns/.nvm/versions/node/v6.9.1/bin
    

    Then the IntelliJ "Play" button worked as intended.