mabn
mabn

Reputation: 2523

java - list environment variables of a running process

Is there an easy way to list environment variables of some running java process?

It's easy to check JVM arguments and system properties using jvisualvm, but it does not show environment.

Upvotes: 2

Views: 3250

Answers (2)

Robin Green
Robin Green

Reputation: 33103

This information is provided by the operating system and is not specific to Java processes. As @agbinfo noted, on Windows use procexp, on Linux/Unix use ps. The specific ps command to use is:

ps e -ww -p 1234

where 1234 is the PID of your Java process.

Upvotes: 3

Vitaliy Polchuk
Vitaliy Polchuk

Reputation: 1898

If it's a Spring Boot application then the environment variables are exposed via /env endpoint as systemEnvironment.

Upvotes: 0

Related Questions