Building an SDL2 program for Android.

Ok, so here is a little open source SDL program of mine that I would like to compile for Android..

Download:
SDL Connex

The game may be interest to some people here.
I am trying to make a script to build it for Android. From the top:

I am using Bookworm64 puppy linux, with devx, SDL2 and Android Studio installed. (I believe you can just install the command line Android NDK/SDK which is much smaller). Now I copy the whole sdl2 lib source folder to my project dir as a folder called SDL2, then I am building it with these commands (as a script):

  export ANDROID_HOME="/root/Android/Sdk"
  export ANDROID_NDK_HOME="/mnt/sda3/android-studio/plugins/android-ndk"
  SDL2/build-scripts/androidbuild.sh com.apm.sconnex sconnex.c sdlwio.c 

I get the reply:
./gradlew installDebug

Now I understand I need to connect my android phone in usb debugging mode, i am not clear how to do that outside studio, but maybe gradlew will sort it out?

I connect the phone and type
./gradlew installDebug

from the “SDL2/build/projectname” folder. when i do that, i get:

“Error: JAVA_HOME is not set and no ‘java’ command is in your path.”

I try:

export JAVA_HOME=“/mnt/sda3/android-studio/plugins/java”

but I still get an “invalid directory” error..

Any ideas?

EDIT:
so to enable usb debug mode you multi click on system/build, then enable usb debug from system/developer..

now i try:

export JAVA_HOME=“/mnt/sda3/android-studio/jbr/”
./gradlew installDebug

it runs! it downloads from gradle.org, but then:

Exception in thread “main” and a long list of errors..