Build Error when building for Android - building on Windows 10

Hi, I am all new to Solar2D but I am very excited to get going. I’ve downloaded Solar2D (build 3626) for Windows 10 and tried all samples with the Simulator. Not all samples can run in the simulator so I am now trying to build the samples for Android and test them live on my phone (Android Samsung Galaxy Note 8) but I always get exceptions when I build. I have today downloaded and installed Java SDK v 15.0.1 and a year ago I took two Android Mobile Development classes at university so I do have Android Devleoper Studio with a couple of Android SDKs installed as well and working.

When I build the samples on Solar2D Simulator I do get a lot of exceptions in the console with the end msg:
"
15:57:30.560 Warning:
15:57:30.560 The signer’s certificate is self-signed.
15:57:30.560
15:57:30.560 The timestamp will expire on 2030-10-17.
15:57:34.719 Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
15:57:34.719 java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
15:57:34.719 at org.codehaus.groovy.vmplugin.VMPluginFactory.(VMPluginFactory.java:43)
15:57:34.719 at org.codehaus.groovy.reflection.GroovyClassValueFactory.(GroovyClassValueFactory.java:35)

15:57:34.719 * What went wrong:
15:57:34.719 Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
"
I have no clue of how to fix this or what is causing it. I tried to follow the help at for example https://docs.coronalabs.com/guide/distribution/androidBuild/index.html but can’t get it to work. Any pointers would be appreciated on how to build for Android and to test it live on an Android phone?

Is there a good guide of how to live build and debug with ADB with an Android phone connected with USB?

/Fred

If you search the forums this has been answered many times.

Feedback to community. I downloaded and installed Java JDK 8 for Windows (Java SE Development Kit 8u271, version Windows x86 i586) and now I can build. Note: I first tried with the Windows x64 version but it did not not work.
This is the download I used: Java 8 JDK 8