Robust Java version number check