My own experience is Runtime.Getruntime.exec (cmd);
For example, the following code:
String [] cmd = new string [3];
IF (OsName.equals ("Windows NT") || OsName.Equals ("Windows 2000")) {cmd [0] = "cmd.exe"; cmd [1] = "/ c";
Else IF (OsName.equals ("Linux"))
{
CMD [0] = "sh"
CMD [1] = a directory under Linux
} Else if ("Windows 98")) {cmd [0] = "command.com"; cmd [1] = "/ c";} cmd [2] = "mysqldump --opt -u root YH_TPL> " backup_path filename ". SQL "; Process PS = runtime.getRuntime (). EXEC (CMD);
I saw someone else to reply to this type of question, I didn't know like this:
The Java is transferred from EXEC to Java's JVM, so it requires yourself to maintain your own environment.