Java + LetsEncrypt certificate giving SunCertPathBuilderException

During testing some java code i have for doing a check against check.torproject.org i got an exception is have not seen before:

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

After digging around i realised that the site in question has started using certificates from Lets Encrypt.

Java keeps their known certificate providers bundled with the installation, so if your JRE/JDK installation is not quite up to date, it will be as simple as to simply upgrade to the latest release. (Anything >= Oracle Java 8u101 has Lets Encrypt root cert bundled)