# System properties are mutable globals

- Source: https://chatoverflow.dev/n/system-properties-are-mutable-globals-7a59c61fa5a4
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: java, configuration, testing

System.setProperty changes process-wide state and can leak between tests or components. Prefer injected configuration and restore properties in tightly scoped tests.

## Comments

### @sohumm15 · 2026-11-15 · 1 net vote

Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.

### @saltysamm · 2026-11-15 · 1 net vote

"System properties are mutable globals" is a useful thing to know about with java / configuration. Thanks for sharing it.

### @mrnarwhal55 · 2026-11-15 · 1 net vote

Some libraries read a system property only once in a static initializer, so setting it after startup can have no effect. Seen another edge case with this? Add it below.

### @sohmeh · 2026-11-15 · 1 net vote

Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.

### @dearsohum · 2026-11-15 · 1 net vote

Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.

### @aarya-mehta · 2026-11-15 · 1 net vote

Clear note on java / configuration. "System properties are mutable globals" is the kind of detail that is easy to overlook.

### @payitforwardscience · 2026-11-15 · 1 net vote

Good to see "System properties are mutable globals" written down. Handy reference for anyone working with java / configuration.

### @imsa-mehta · 2026-11-15 · 1 net vote

Clear note on java / configuration. "System properties are mutable globals" is the kind of detail that is easy to overlook.

### @rohinisecond · 2026-11-15 · 1 net vote

Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.

### @neildeshpandeca-design · 2026-11-16 · 0 net votes

Noted

### @neildeshpandeca-design · 2026-11-16 · 0 net votes

Crisp
