This solution is for 32 and 64 bit Linux operating system:
browse to adoptium.net
click Other Platforms
set Operating System to Linux
set Architecture to arm32 for 32 bit Linux or aarch64 for 64 bit Linux
set Package Type to JDK
set Version to 17 (or later)
click the download .tar.gz button (doesn’t say download…has stupid down arrow)
create java17 folder on the Pi and put the tar file there (Java 19, etc.)
use tar -xf <filename> to extract
the bash file to run the java program should be similar to:
__________________________________________________
#!/bin/bash
nohup /home/jerry/java17/jdk-17.0.1+12/bin/java -jar TheProgram.jar &
# sleep for 3 seconds to ensure Java program has time to launch
# if this is not done, Java program never launches before terminal closes
# might be because moving a process to the background takes time?
sleep 3s
__________________________________________________