I need to execute the less
command, with paging, from my Java console application. However, the only method I found to execute external commands is Runtime.getRuntime().exec()
, which requires me to write/read input/output via streams. So commands like cat
work (and less
does in fact act like cat
), but I need the paging functionality.
In C, I'd use system()
. In Ruby, Kernel.exec does the job.
Is there any way to get this done in Java?