Based on https://jena.apache.org/documentation/tools/ I tried:
sudo apt install openjdk-22-jre
wget https://dlcdn.apache.org/jena/binaries/apache-jena-4.10.0.zip
wget https://dlcdn.apache.org/jena/source/jena-4.10.0-source-release.zip
unzip apache-jena-4.10.0.zip
cd jena-4.10.0
export JENA_HOME="$(pwd)"
export PATH="$PATH:$(pwd)/apache-jena/bin"
but then when I tried to run:
sparql
it failed with:
Error: Could not find or load main class arq.sparql
Caused by: java.lang.ClassNotFoundException: arq.sparql
The problem is that I downloaded the source distribution from the downloads page https://jena.apache.org/download/index.cgi, instead you have to download the prebuilt one which contains the JAR files (or build them yourself):
and we can confirm it works with:
which outputs: