Java program that relaunches itself in OS's terminal application
A few empty lines here and there would do wonders to the readability.



This will also relaunch the application if it was started from a terminal without arguments.



String path = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getAbsolutePath();




String os = System.getProperty("os.name").toLowerCase();
...
if(os.contains("mac")){


Unfortunately that is a quite fragile way to detect the current operating system, but it will do.



On nay other operating system, you simply start reading commands (or not), are you aware of that?

You should have the command reading in an else branch.



System.exit(0);


Please stop sprinkling your code with those. System.exit makes the JVM exit immediately, it is like a SIGKILL on UNIX. That means that not even final branches are being run when invoked.



while(true)
    nextCommand();


I assume that there is a "quit" command which calls System.exit, that might be a bad idea. A better idea would be to have something like this:

while(commandExecutor.isActive()) {
    commandExecutor.readAndExecuteCommand());
}