0

When I run my Play app using activator start I get the following error:

(Starting server. Type Ctrl+D to exit logs, the server will remain in background )

The syntax of the command is incorrect.

Every thing works when running in dev mode using run. I'm not quite sure where to look to fix this, what might the issue be?

sebster
  • 1,322
  • 2
  • 18
  • 29
Neilos
  • 2,696
  • 4
  • 25
  • 51
  • Can you share Activator version? – marvin82 Apr 14 '15 at 05:32
  • Activator 1.2.10, I'm just about to install Activator 1.3.2 but i don't think this will make a difference, I just mention it for more complete info. I'm going to deploy on a linux machine eventually so I think that that will solve the issues. I am yet to try any of sebster's suggestions on Windows but I will do that asap. – Neilos Apr 14 '15 at 15:38

2 Answers2

0

This is a known issue caused by long variables beying generated when the project directory structure is too long.

Long story short: it's a cmd.exe limitation.

See Activator start does not works for JDK 8 on windows 7 and Activator start errror - Bad application path: -Dhttp.port=9000

Solution(s):

  • Put your project on a short path like C:\your_project_name.

  • Or, try lampz's solution(same underlying problem):

Windows solution:

1 - "activator stage" in the command line

2 - Copy the stage directory from target\universal\stage to c:\stage to avoid issues with long file paths

3 - To avoid the Bad Application Path issues just create a new .bat file with the following (my project is called proj): set PROJ_OPTS="-Dconfig.file=../conf/application.conf" proj.bat

Note: change PROJ_OPTS to YOURPROJECTNAME_OPTS and proj.bat to yourprojectname.bat

See also: Play Framework 2 Stage Task on Windows, “The input line is too long”

Community
  • 1
  • 1
sebster
  • 1,322
  • 2
  • 18
  • 29
  • I tried all the solutions and it made no difference. I will get my hands on a linux machine soon and hopefully that will work but it's a bit annoying that I can't get it to work on Windows. i'm a bit stuck with this one. – Neilos Apr 14 '15 at 16:06
  • I assume that this is also to do with the classpath being too long (because of the long dir structure). I used wildcards for the classpath in the `.bat` file but it made no difference. – Neilos Apr 14 '15 at 16:08
  • "I assume that this is also to do with the classpath being too long" -> quite possible and it would explain why none of the solutions solved the problem for some users. – sebster Apr 14 '15 at 16:15
  • As for the linux machine... it will work and compilation will be noticeably faster as well. – sebster Apr 14 '15 at 16:16
  • One more thing. Did you do a clean, reload, recompile after changing the project location? Cause that should regenerate your classpath. – sebster Apr 14 '15 at 16:18
  • Ahh no i didn't. I'll try that when I get a chance. – Neilos Apr 14 '15 at 18:12
0

You can create you production code using activator and run it with the following command -

java -Dhttp.port=9000 %1 -cp "lib/*;" play.core.server.NettyServer .
Rakesh Chouhan
  • 1,196
  • 12
  • 28