Build cleanups

The `build.py` script doesn't need to run `generate-exports.js` directly.  In addition, `build.py` doesn't run `java` or `jar` directly.

Fixes #2337.