How to execute "less" with paging from a Java console application?
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.

Is there any way to get this done in Java? In Ruby, [Kernel.exec][1] does the job.

  [1]: http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-exec
How to execute "less" with paging from a Java console application?
===

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.

Is there any way to get this done in Java? In Ruby, [Kernel.exec][1] does the job.

  [1]: http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-exec