Plus, is it really illegal to export cryptography software? If that is the case, why are Java downloads the only ones restricted? Shouldn't, for example, Visual Studio and .Net also be blocked? I don't think it is for any valid legal reason. Just that they cannot make money from these countries, so they can't be bothered to let them access their download servers.
Microsoft does not sell products to any sanctioned countries[2].
Note that [1] has a giant loophole for open source software, which requires notice but not permission - so builds of .NET Core, OpenJDK, OpenSSL itself, and so on, can be exported no problem. Also, programs built WITH the primitives are "mass market", so are exemptable that way.
[1]: https://www.bis.doc.gov/index.php/policy-guidance/encryption [2]: https://www.microsoft.com/en-us/exporting/faq.aspx
The Oracle JRE contains strong cryptography which is illegal to export to certain sanctioned countries. It being free doesn't change anything about that. That one is actually legitimate.