$PATH is resolved by the shell, so you'll need to execute this command using a shell: sh -c $PATH. If you're using Windows, the command should be cmd /C echo %PATH%. Note that Windows uses %PATH% instead of $PATH.
Edit: basically what N Sahni said
There is just one flaw in that code: the error stream should also be read. See When Runtime.exec() won't. In this case the solution is simple: add process.redirectErrorStream(true); before line 7.
As you are redirecting errorStream here, it means it shows as error if we run "sh -c $PATH", right?
when I run "echo \$PATH" on shell, it gives me output as: $PATH.
Doesn't it mean that Java automatically adds "\" before "$" sign as Runtime.getRuntime().exec("echo $PATH") also gives me the same output?