0
$ javac Increment.java

Output:

Increment.java:6: ??: ?????
    System.out.println(++a++);
                          ^
  ??: ??
  ??:    ?
1 ???

here is the code

class Increment{
  public static void main(String[] args) {
    int a = 5;


    System.out.println(++a++);
  }
}

Does any one know what may be happening and how to fix it? Increment is just a class for testing so that a error will appear. I am running it in git-bash terminal, but I have tried it in cygwin terminal and windows's terminal as well. character-set is UTF-8.

Kallzvx
  • 594
  • 7
  • 23

1 Answers1

1

Most probably you have a national locale set up (e.g. Russian, Chinese or anything else) that makes the Java compiler to return nationalized error messages, but your terminal (cygwin) does not support the UTF-8 output or your system does not support UTF-8 locale.

As the quickest work-around you could switch java compiler to provide error messages in English:

$ javac -J-Duser.language=en Increment.java
Vladimir L.
  • 1,116
  • 14
  • 23