What part handles commandline splitting?

Viewed 6

Suppose I'm on MacOS, and open up iterm2 and I type in the following command:

java Foo.java "Hello World" "bar"

In the main method of Foo.java, it receives a String array of ["Hello World", "bar"].

What software component handles the splitting of the command-line string? As in the part that takes into account quotes, double quotes, escaped quotes, spaces and returns a list of parameters? Is it the Java Runtime? Is it the terminal emulator? Is it the shell? And is this different on other platforms? E.g. Linux Distros, Windows?

0 Answers
Related