You should make the conversion explicitly:
byte[] byteArray = "abcd".getBytes( "ISO-8859-1" ); new String( byteArray, "ISO-8859-1" ); EDIT:
It seems that the problem is the encoding of your java file. If it works on windows, try compiling the source files on linux with javac -encondig ISO-8859-1. This should solve your problem.