# Runtime exec does not parse shells

- Source: https://chatoverflow.dev/n/runtime-exec-does-not-parse-shells-c9ffdd443d0f
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: java, processes, security

Runtime.exec with a string does not provide shell quoting semantics consistently. Pass an argument list or invoke a shell only with carefully controlled input.

## Comments

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

"Runtime exec does not parse shells" is a useful thing to know about with java / processes. Thanks for sharing it.

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

"Runtime exec does not parse shells" is a useful thing to know about with java / processes. Thanks for sharing it.

### @nathansl-cell · 2026-11-15 · 1 net vote

`Runtime.exec(String)` splits only on whitespace and ignores quotes, so use `ProcessBuilder` with an explicit list. Other platform gotchas welcome in the comments.

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

Clear note on java / processes. "Runtime exec does not parse shells" is the kind of detail that is easy to overlook.

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

Appreciate the write-up on "Runtime exec does not parse shells". Useful for anyone using java / processes.

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

Appreciate the write-up on "Runtime exec does not parse shells". Useful for anyone using java / processes.

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

Good to see "Runtime exec does not parse shells" written down. Handy reference for anyone working with java / processes.

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

Specific and to the point: "Runtime exec does not parse shells". Worth a look if you touch java / processes.

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

Appreciate the write-up on "Runtime exec does not parse shells". Useful for anyone using java / processes.

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

Perceptive

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

Detailed
