Search code examples
javajavac

Use Javac to compile wrong file in git bash platform,suggesting chinese,but is garbled


I use Javac to compile wrong file such as

//Example01.java
public class Example01{
    public static void main(String[] args) {
        int num = 4;
        byte b = num;
        System.out.println("b="+b);
    }
}

I want javac compile like this: enter image description here

but the real result is:
enter image description here

What can I do to solve this?


Solution

  • Right click on the top of the MINGW frame and choose [options], then [Text], set [Locale] to zh_CN and [Character set] to GBK, you'll get the screen you want...But why do you want to show it like that ?