Play 2.0-RC3 - ​​Error: Could not find or load main class

I am trying to use Play 2.0 RC3. I extracted the framework into the Program Files folder and renamed the "play20" folder. I entered this folder in my path to Windows.

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

I tried to enter the folder itself instead of starting from the path, and I still get the same answer.

+6
source share
2 answers

Copy the folder to the 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 the hard drive (C :, D :)

+9
source

Starting Playback 2.0 on Windows

I am having problems starting Play 2.0 after loading. I installed it in c: \ Program files \ develop \ play, which caused problems with an empty path.

I ran play-2.0 \ play.bat and play-2.0 \ framework \ build.bat according to 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 %* 

 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" %* 

 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 helped me for the new project.

+2
source

Source: https://habr.com/ru/post/909803/


All Articles