I have 1.8.0_65, but according to the linked thread it is the cryptography that is the culprit.
So - actually these are the steps I need to take to make it work if I delete the build directory:
java -Djava.ext.dirs= -jar /Applications/Defold/bob.jar --archive --platform js-web build
This will give me the “Unable to create ManifestFile, hashing algorithm is not supported!” error (regardless of using the Defold or default Java), but most of the project will be built so after that running
java -jar /Applications/Defold/bob.jar --archive --platform js-web build
Finishes successfully and I can then bundle.