Search code examples
javaandroid-studiogradlelibgdxgradlew

LibGDX tools.jar missing


One day ago I created a new LibGDX project. All worked fine and I could also export the HTML files to test my project on a server. I have used gradlew.bat

html:superDev

for debug and

gradlew html:dist

to export the project. But today when I try to compile for html gradle says

Could not find tools.jar

Error


Solution

  • The tool.jar is a library included in JDK (Java Developement Kit). The problem you have met is that you probably do not have JDK - just JRE (Java Runtime Environment). If you do have this then your Android Studio does not know where it is (and probably has set up the path to JRE).

    In first case you can download and install JDK from official Oracle site.

    In second you need to go to the Project Structure

    enter image description here

    then provide proper JDK path:

    enter image description here

    Your IDE may need also restart after change.