Final answer:
A Java compiler will report an error with a switch statement if the expression value is a real number or any unsupported type. The switch supports byte, short, char, int, their wrapper classes, enums, and Strings, but not real numbers like float or double.
Step-by-step explanation:
When compiling a Java program, the Java compiler will report an error with a switch statement if the value of the expression is a real number or not supported by the switch. The correct answer to when a Java compiler will report an error is: If the value of the expression is a String or a real number.
The switch statement in Java supports several data types for its expression, including byte, short, char, int, their respective wrapper classes, enum types, and as of Java 7, String.
However, switch does not support real numbers (e.g., float or double), because real numbers are not discrete and do not match the requirement of having a limited number of identifiable values precise enough for case labels. So option b is the correct one, and whenever there's an attempt to use a real number or an unsupported type in a switch expression, the Java compiler will report an error.