Reputation: 21
When exporting for android using Gradle build I get this error I have no other java alternatives I installed openjdk-17 through $ sudo apt install openjdk-17-jdk openjdk-17-jre command my Path is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/games:/usr/local/games:/snap/bin:/home/gordey/.dotnet/tools:/home/gordey/.dotnet:/usr/lib/jvm/java-17-openjdk-amd64
This is my ~/.bashrc (not sure I set this up correctly) I'm opening project through terminal using this command: $ godot4 /home/gordey/projects/godot-test -e
[There is no java.sh in my profile.d folder so I couldn't try this method text](https://i.sstatic.net/82YzUQUT.png)
I tried adding /bin to the end of JAVA_HOME but it changes nothing I tried setting JAVA_HOME in .profile and open godot though the same terminal window and it didn't work too
Upvotes: 2
Views: 842
Reputation: 560
You need to add the Java SDK path in Editor Settings -> Export -> Android:
After changing this, you will need to delete the /android/build folder from your project, and also the USER_HOME/.gradle folder on your system.
Then you can reinstall the build template via Project -> Install Android Build Template... and it will pick up the correct path.
Upvotes: 1