Categories
environment-variables java spring spring-boot

Read environment variable in SpringBoot

What is the best way to read environment variables in SpringBoot?

In Java I did it using:

String foo = System.getenv("bar");

Is it possible to do it using @Value annotation?