How to get play! framework running in MSYS bash
Asked Answered
J

3

8

I can’t use play! framework from a MSYS shell (as used in Git on Windows).

Error during sbt execution: Could not find configuration file
'c:/Dev/Prg/Play/framework/sbt/play.boot.properties'.  Searched:
        file:/C:/Users/Paul/
        file:/C:/Users/Paul/
        file:/C:/Dev/Prg/Play/framework/sbt/

Is there a way to get this running?

Josefina answered 4/5, 2012 at 20:14 Comment(1)
+1. Just ran into the same problem. Guess I'll just have to run it in the regular command prompt for now.Shroudlaid
J
10

A solution to this problem has been posted on the Play mailing list: There’s a patch that solves the problem.

diff -r --unified play-2.0-orig/framework/build play-2.0-cygwin/framework/build
--- play-2.0-orig/framework/build   2012-03-12 20:25:28.000000000 -0700
+++ play-2.0-cygwin/framework/build 2012-06-15 17:56:57.436000000 -0700
@@ -8,4 +8,4 @@
   DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${JPDA_PORT}"
 fi

-java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -Dfile.encoding=UTF8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
\ No newline at end of file
+java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -Dfile.encoding=UTF8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=$BOOTPROP`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
diff -r --unified play-2.0-orig/play play-2.0-cygwin/play
--- play-2.0-orig/play  2012-03-12 20:22:03.000000000 -0700
+++ play-2.0-cygwin/play    2012-06-15 20:48:41.624800000 -0700
@@ -1,5 +1,23 @@
 #! /usr/bin/env sh

+case `uname` in
+  CYGWIN*)
+    function dirname {
+      cygpath -m `command dirname $@`
+    }
+    typeset -fx dirname
+    export BOOTPROP="file:///"
+    ;;
+  MINGW32*)
+    function dirname { (cd `command dirname $@`; pwd -W) }
+    typeset -fx dirname
+    export BOOTPROP="file:///"
+    ;;
+  *)
+    export BOOTPROP=""
+    ;;
+esac
+
 PRG="$0"
 while [ -h "$PRG" ] ; do
     PRG=`readlink "$PRG"`
@@ -54,5 +72,5 @@
   fi

 else
-  java -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
+  java -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$BOOTPROP$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
 fi
Josefina answered 21/6, 2012 at 19:13 Comment(0)
M
4

A solution for play-2.1.3.

  1. start mingw32
  2. cd /path/to/play-2.1.3
  3. patch -p1 < /path/to/play_cygwin.patch

Copy of this patch:

diff -r --unified play-2.1.3/framework/build play-2.1.3-cygwin/framework/build
--- play-2.1.3/framework/build   2013-08-06 12:29:56 +0000
+++ play-2.1.3-cygwin/framework/build   2013-09-04 13:44:05 +0000
@@ -10,4 +10,4 @@
   DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${JPDA_PORT}"
 fi

-java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M ${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
+java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M ${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=$BOOTPROP`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
diff -r --unified play-2.1.3/play play-2.1.3-cygwin/play
--- play-2.1.3/play 2013-09-04 02:44:05 +0000
+++ play-2.1.3-cygwin/play  2013-09-04 13:51:36 +0000
@@ -1,5 +1,23 @@
 #! /usr/bin/env sh

+case `uname` in
+  CYGWIN*)
+    function dirname {
+      cygpath -m `command dirname $@`
+    }
+    typeset -fx dirname
+    export BOOTPROP="file:///"
+    ;;
+  MINGW32*)
+    function dirname { (cd `command dirname $@`; pwd -W) }
+    typeset -fx dirname
+    export BOOTPROP="file:///"
+    ;;
+  *)
+    export BOOTPROP=""
+    ;;
+esac
+
 PRG="$0"
 while [ -h "$PRG" ] ; do
   PRG=`readlink "$PRG"`
@@ -61,5 +79,5 @@
   fi

 else
-  "$JAVA" -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
+  "$JAVA" -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$BOOTPROP$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
 fi
Mindi answered 4/9, 2013 at 15:0 Comment(0)
S
1

I faced the same problem. In my case the problem occurred because of having space in directory name. I renamed one of my folder that contained space in it's name and my problem was solved.

Sager answered 18/2, 2014 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.