-1

Does anyone know if there is such a thing as a run-configuration launcher for the JVM for "production"?

Where you can set environment variables and arguments, just like in an IDE ?

  • I mean have multiple configurations you can choose from to use – ycomp Jun 15 '16 at 19:37
1

An IDE is there to help you develop your application. In production, the application is running, it has moved beyond developing.

So if you want different run configurations for production you have two main options:

  • during the build and deploy stage (with Ant, Maven, Jenkins, etc) you package your application with the configurations you need inside it and then the application will run in production using those configurations. For example, you might have a file settings.properties, one settings-stage.properties and one settings-prod.properties and during the build, based on the environment you are building, replace settings.properties with either settings-stage.properties or settings-prod.properties. This can also be extended to having multiple settings-prod.properties files and chose between them in the same way (e.g. settings-prod-run-configuration-1.properties, settings-prod-run-configuration-2.properties, etc);
  • start your application on production using a script that sends the appropriate parameters to the java executable. This can be a script with flags (e.g. start-app.sh --run-config=configuration-1, start-app.sh --run-config=configuration-2, etc) or you can have separate script files instead of one (e.g. start-app-run-configuration-1.sh, start-app-run-configuration-2.sh, etc).

In production you usually achieve the same thing you do with the IDE UI by using scripts and config files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.