Using environment variables to determine test/prod etc is not idiomatic for desktop apps, that may be common on the server but not there. You can use instead for example system properties, where the system property that means "prod" is set in your packaging. If you use
Conveyor you can easily do this with one line in your package config file, if you use the built in jpackage-based tooling then I don't remember but it's probably possible also.