/**************由于Linux会将0x0D认为是回车,所以以下作特别设置,请参考stty命令*********/
//input setting
String command = "stty -F "+comPort+" -icrnl";//translate carriage return to newline
Runtime.getRuntime().exec(command);
//output setting
command = "stty -F "+comPort+" -onlcr";//translate newline to carriage return-newline
Runtime.getRuntime().exec(command);
/******************************************************************************/