powered by Slim Framework
Follow @NesbittBrian rss

Adding initial Windows support for the Play! Framework 2.0 preview

Sep 8, 2011

As many of you saw the Play framework team released their plans on the upcoming 2.0 release. I tried it out on a remote linux machine and it worked as expected. My desktop runs Windows though and the current preview package doesn't work on Windows yet, but its a pretty simple task to get it up and running for now until official support is added.

Download the preview package and unzip to c:\ (or a directory you prefer, but the rest of the post will assume c:\) so you now have a c:\play-2.0 directory.

Download play.bat and put it in c:\play-2.0

Download build.bat and put it in c:\play-2.0\framework

In the following commands I'll use the full path to the play.bat file as some of you will probably have a previous version of play.bat in your PATH and we want to ensure we are running the correct version.

Now lets go ahead and create a new project.

cd \
mkdir newproject
cd newproject
c:\play-2.0\play.bat new

The framework will now ask for an application name. You can specify something else or just hit ENTER to accept the default newproject. Once accepted a full Play! 2.0 project will be created in the current directory.

Now lets go ahead and run the new project via the new Play! console.

c:\play-2.0\play.bat    #shows some [info] logs and then runs the console

Once the console is running and waiting for your command, type run. Now open a browser to and say Hello!

You can also launch the console and auto run with c:\play-2.0\play.bat run as usual. Hitting CTRL-D will just drop you back to the console.

I forked the project on github and had recompiled the framework to test the .bat files and I got some weird dependency issues. I fixed it by deleting my ~/.iv2 contents which for me was located at c:\Users\brian\.ivy2. This tip was taken from the Play20/README.textile repo so thanks to guillaume for that simple but useful comment, otherwise this wouldn't have gotten done.

Looks like this means I now have to start looking into Scala some more.

Congrats to the Play! team and also to the community as we get to reap the benefits of their hard work!

UPDATE: to fix the ANSI control characters in the play output see ANSI colour support in Windows for the Play! Framework 2.0 preview

A carpenter's house is always the last to get the attention it deserves  Home ANSI colour support in Windows for the Play! Framework 2.0 preview  
blog comments powered by Disqus