What exactly is “tools.jar” in the Android SDK?

老子叫甜甜 提交于 2019-12-12 13:03:12

问题


So, I've been trying to build a project in LibGDX for about 10 hours now. In case you'r unfamiliar, LibGDX is one of those platforms where you specify a project directory at the start, along with any required SDKs and then when you're ready to start coding it will generate a project for you.

Anyway, I've been having a problem where every time I try to build it fails with the single error message:

Execution failed for task :core:compileJava.

Could not find tools.jar

I'm guessing "tools.jar" is a package within the Android SDK, as this is the only repository needed to build, it doesn't ask for a JRE or even the Java SDK. just the Android SDK.

I have been looking in the SDK manager, I have installed all of the packages labelled "Android-SDK Tools", "Android-SDK Platform Tools" and "Android SDK Build Tools" but there is nothing else that includes "tools.jar", I am looking for some light shed on this topic as it is a very grey area. I would like to know where this .jar file comes from and what exactly it includes. Can it be installed from the Android SDK?

There have been similar questions like this before which only fit narrow situations, If someone could provide a holistic description of the tools.jar package it would benefit a great deal for me and everyone else that needs it in their 3rd-party android IDEs.

For the record, it's building with Gradle and my current SDK is well-equipped enough to build full-fledged apps in Android Studio.

Please don't answer this question with a question unless I have left out some information that is dire to finding an adequate solution


回答1:


Try copying tools.jar from %JAVA_HOME\lib to Android Studio\lib




回答2:


For me, copying tools.jar to Android lib folder alone didn't solve my problem.

But I also had to create a System Variable 'JAVA_HOME' in Windows Environment Variables with path to the latest JDK folder.

Restarted Android Studio, and this solved by problem.




回答3:


In my case, I have five jdk and some have tools.jar and other not, my solution is copy paste this tools.jar in all lib of jdk.



来源:https://stackoverflow.com/questions/31182240/what-exactly-is-tools-jar-in-the-android-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!