In Python, we use import os os.system('sudo vncserver stop') What about in Java. Below is one example. import java.io.*; public class java_system_call { public static void main(String args[]) { String s = null; try { // run the Unix "ps -ef" command // using the Runtime exec method: Process … Continue reading How to run system commands Java (Linux environment)