Take a look at the jq command it is a command line json parser. You can pull any field you would like.
https://www.systutorials.com/docs/linux/man/1-jq/
For example this will return the java_version number.
cat variable.json | jq .java_version
cat variable.json | jq .java_version
If you prefer using core commands so you don't have to install anything you can use this command.
cat input | grep java_version | awk '{print $NF}'
cat input | grep java_version | awk '{print $NF}'
Shorter version of the above command before someone says you don't have to cat into grep.
grep java_version variable.json | awk '{print $NF}'
grep java_version variable.json | awk '{print $NF}'
EDIT: Another option would be.
sudo yum install -y jenkins-$(grep java_version variable.json | awk '{print $NF}' | sed 's/"//g')-openjdk
sudo yum install -y jenkins-$(grep java_version variable.json | awk '{print $NF}' | sed 's/"//g')-openjdk