Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running a Java program on Mac OS X 10.8 (from the Terminal), and the Java VM's file.encoding is defaulting to "SJIS". I even tried a tiny Java program that does nothing but print out the system properties, and that shows that the Java VM itself is defaulting to SJIS. (And let's face it, nobody likes SJIS!)

My terminal is set to UTF-8. My $LANG isn't set, and $LC_CTYPE is "UTF-8". No environmental variable or Terminal setting has "JIS" in it anywhere, AFAICT.

On Java on Mac OS X, where does it get the file.encoding value from? Is there a system setting I can change so that it uses UTF-8? I don't want to have to specify this per-application and per-library, because that is somewhere between "awkward" and "impossible", depending on the program.

I suppose I'm OK with setting an environmental variable for this, but I can't find any standard variables (like $LANG) that affect Java.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.