0

How do I pass command-line arguments when starting Play 1.x? I've found an example for selecting an HTTP port or a framework ID, but not for a custom argument.

danovia
  • 29
  • 6

1 Answers1

0

Passing arguments to Play 1.x is not possible. You should use JVM custom arguments instead, with a -D annotation before the property:

play run -Dbla_bla_enabled=true

In your Java code, treat it as a string value:

if(System.getProperty("bla_bla_enabled").equals("true")){
   ...
}

Oh, and remember to check for null if the property might be absent.

danovia
  • 29
  • 6