When starting a Jetty project in IntelliJ, I have no problem reading the environment variable that I set in / etc / environment using System.getenv ("var1") api.
When I deploy war on an Ubuntu server that runs Jetty on boot, I get null when I call System.getenv ("var1")
When I run a simple console application on the server under my user (user suder), I get the environment variable now.
What do I need to do so that the environment variables in / etc / environment are visible to the war when it starts automatically outside the user's session?
Zayky source share