Question

I am trying to use Play 2.0 RC3. I have extracted the framework into my Program Files folder, and renamed the folder 'play20'. I entered that folder into my Windows path.

When ever I run Play, whether it being play help or play new, I always get Error: Could not find or load main class Files\play20\repository

I tried going into the folder itself instead of running from the path and I still get the same response.

Was it helpful?

Solution

Copy the folder to a path without spaces in the name. "Program Files" has a space in the name and this often causes problems.

As a suggestion, copy the Play folder to the root of a hard drive (C:, D:)

OTHER TIPS

Running Play 2.0 in Windows

I had Problems running Play 2.0 after download. I installed it in c:\Program files\develop\play which caused problems with the blank in the path.

I patched the play-2.0\play.bat and play-2.0\framework\build.bat according to the space-paths.patch in this playframework google group entry

In play-2.0\play.bat replace the code

setlocal

set p=%~dp0
set p=%p:\=/%
set buildScript=%~dp0framework\build.bat
set additionalArgs=%*

if exist "conf\application.conf" goto existingApplication

:noApplication
java -Dsbt.ivy.home=%~dp0repository -Dplay.home=%~dp0framework -Dsbt.boot.properties="file:///%p%framework/sbt/play.boot.properties" -jar %~dp0framework\sbt\sbt-launch.jar %*

by

setlocal enabledelayedexpansion

set p=%~dp0
set p=%p:\=/%

set fp=file:///!p: =%%20!
set buildScript="%~dp0framework\build.bat"
set additionalArgs=%*

if exist "conf\application.conf" goto existingApplication

:noApplication
java -Dsbt.ivy.home="%~dp0repository" -Dplay.home="%~dp0framework" -Dsbt.boot.properties="%fp%framework/sbt/play.boot.properties" -jar "%~dp0framework\sbt\sbt-launch.jar" %*

and in play-2.0\framework\build.bat replace the code

set PLAY_VERSION="2.0"

if defined JPDA_PORT set DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%JPDA_PORT%"

set p=%~dp0
set p=%p:\=/%

java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*

by

setlocal enabledelayedexpansion

set PLAY_VERSION="2.0"

if defined JPDA_PORT set DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%JPDA_PORT%"

set p=%~dp0
set p=%p:\=/%
set fp=file:///!p: =%%20!


java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% %JAVA_OPTS% -Dfile.encoding=UTF-8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="%fp%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*

:end
endlocal

This did the trick for me for a new project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top