top of page

Run Mac or Linux command from Java

Can we run Mac or Linux command from Java Application?


The answer is "YES!".

Yes, we can. Let's see how..


We can use ProcessBuilder class which is to create operating system processes.


There is a good guide about ProcessBuilder with detail explanation at the following links:


If we want to run external command on Mac or Linux, we have to run on "bash" and same shell. So, "bash', "-c" command also needed.

Comments


Single post: Blog_Single_Post_Widget
bottom of page