How to open Terminal and execute command using java code in OSX
问题 How to launch terminal and execute some commands using java code in MAC? Similar question i have found for LINUX OS from below link. how to run a command at terminal from java program? 回答1: It worked same as Linux, Runtime.getRuntime().exec("rm filename"); Thanks @ginz 回答2: You need to run it using bash executable like this: Runtime.getRuntime().exec("/bin/bash -c **YouTerminalSoftWareName**"); YouTerminalSoftWareName must be absolute path or aready in your PATH environment variable 回答3: Use