A variable that is declared final cannot be incremented, because when an access of a final variable is used as an expression, the result is a value, not a variable. Thus, it cannot be used as the operand of a postfix increment operator.
You're attempting to perform an increment operation on a constant value, 5. This is roughly equivalent to performing an increment operation to a final variable.
In this case, the JVM would have to evaluate 5++. In that case, it would use the value 5 as the initial value and then update the variable 5. That doesn't make any sense.
In short, Java expects a variable in this position - a constant value is not allowed. You can get that from the error message, as well:
Test.java:5: unexpected type
found : value
int i = ++5;
I hope that helps,