String cmds[] = new String[] { "cmd", "/c","C:\Test.txt" };
Runtime.getRuntime().exec(cmds);
Currently, I use the above code to open a txt file on local. However, it will be opened by notepad and not be kept the original format . I want to open default by notepad++ to fix this. Please tell me the way to process this case. Thanks.
notepad++command isn't recognized by the command line, e.g. the path variable isn't set.