Search code examples
javagoogle-closure-compileremscripten

How to install Java required for closure compiler?


I'm trying to build an Emscripten project but I get the following error:

shared:WARNING: java does not seem to exist, required for closure compiler, which is optional (define JAVA in /Users/cuinjune/.emscripten if you want it)
shared:ERROR: fatal: closure compiler is not configured correctly

I installed JDK but it didn't work.

Based on this link: https://emscripten.org/docs/building_from_source/verify_emscripten_environment.html

I tried ./emsdk install java-7.45-64bit but it says:

Error: No tool or SDK found by name 'java-7.45-64bit'.

What should I do to fix this error?


Solution

  • Are you using Mac? Just install generic OpenJDK or OracleJDK from Oracle website and set JAVA environment variable.