I have a library and I want to use it in my astudio project. I tried running the command "gradlew publishToMavenLocal" and received the following error-JAVA_HOME is not set and no 'java' command could be found in your PATH.
Asked
Active
Viewed 77 times
0
-
have you tried to search for solutions regarding your error ? – a_local_nobody Jan 11 '20 at 19:21
-
3Does this answer your question? [Intellij Gradle terminal ERROR: JAVA\_HOME is not set](https://stackoverflow.com/questions/41449882/intellij-gradle-terminal-error-java-home-is-not-set) – a_local_nobody Jan 11 '20 at 19:22
1 Answers
0
You can choose which JDK use in File->Project Structure->SDK Location
Or add Variable like in this manual for Windows https://mkyong.com/java/how-to-set-java_home-on-windows-10/
or for Linux in this answer How to set JAVA_HOME in Linux for all users
If JAVA_HOME is the main problem for publishing you'l see your library at .m2 folder in your local gradle repositories
Don't forget add mavenLocal() in your build.gradle repositories

Ilia Kuzmin
- 165
- 8