30 August 2013

How to solve problem with Netbeans 7 display error Could not find or load main class ${jvm.memory} when run Play Framework application ?

Solution for:
Netbeans 7.x
Play Framework 1.2.6,1.2.7

Recent updates for Play Framework was as one of the committer(notalifeform) described "the last two releases were a bit too sloppy ".
It happens.I am sure Play team are too excited about their brand new Play Framework 2.x ,so they do not put too much passion to ancient Play 1.x .

If you using mighty Netbeans and you updated Play to 1.2.6 or  1.2.7,then when you press Run,then you see:

Error: Could not find or load main class ${jvm.memory}
Java Result: 1

Play netbeansify is bit clumsy and do not set jvm.memory :(


What to do?
Go to conf/application.conf:

and add line:

Run program and everything works as before (well almost You will also see error id doesn't exist,but solution is bit more complicated.You can ingore it as long as you do not use id to set mode for various cases ( )

For people who loves definitions:
"   Xmx - It is a Java application launcher's argument.It is used to  specify the maximum size, in bytes, of the memory allocation pool. "

It can be 128m,256m,1232m  ... any memory that is needed for your application

BIG Thanks for Luke (Mr. Late o'clock) F. for solution.(He sent fix to play ,but it was not included in 1.2.7 :( )