Is there a way to launch the command line from java without knowing OS? For example, the method would open up the terminal shell for a Linux OS and open the command line for Windows.
I do know (from looking at previous questions) that i can just check the OS and then open the proper command line, but is there a way to open the command line from a java method that is OS agnostic?
There is no direct or uniform way of doing that across the platforms. One way you can accomplish is
System.getProperty("os.name")).for example: (snippet taken from here )
Please look for the relevant code for different OS
Note: its just a code snippet. It won’t compile as is.