Annoying sun.io.MalformedInputException when moving Java program from Windows to Linux
These day I write Java programs on my local machine and then move them to a Linux server to run experiments. This routine works fine so far. However, when I ran one of the progams, which involves coping one file from one directory to another, I kept on the following error message:
First, I though it was because of the file format problem, since all the files to be moved were created on my local Windows machine. So I manually ran dos2unix command to all the files, but it didn't work. Then I tried to change my code so that it reads and write the files in UTF8 encoding. It still did not help. Finally, I found this post online (http://www-128.ibm.com/developerworks/java/jdk/linux/142/runtimeguide.lnx.en.html). Following its advice, I simply change LANG from en_US.UTF8 to en_US. Problem solved!






Comments
Post new comment