Hi Volodymyr,
Yes, it is safe, and recommended, to upgrade Connector/J to latest version.
MySQL Connector/J latest version is guaranteed to work with all MySQL Server supported versions. This doesn't mean that it stops working with the EOLed ones, especially recently EOLed ones, like the MySQL Server 5.7. It only means that there's is no active support going on assuring this compatibility, most new features won't work there, and there might be a small risk of introducing features that totally break compatibility with older versions - it didn't happen so far.
So, you are safe to proceed. Enjoy!
BTW, if you are upgrading from the older MySQL Connector/J 5.1 series, please mind that there are some caveats and the process may be not so straightforward. Please consult
the documentation for advice.