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.
Asked
Active
Viewed 95 times
1 Answers
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.
![](../../users/profiles/3782107.webp)
danovia
- 29
- 6