Minimum required java version


I have 3 java programs available in the AUR and with Java 9 released there is a small problem.
I made my first package with inspiration from another java program in the AUR and used much of its structure, including the java version check, a check that will fail for Java 9.

So my question is, is there a really really good way to check for a minimum and possible maximum java version?

if ! /usr/bin/java -version 2>&1 | grep 'version "1.8' >/dev/null
	echo "mapollage requires Java 8" >&2
	exit 1
exec /usr/bin/java -jar '/usr/share/java/mapollage/mapollage.jar' "$@"


Where is run the java version check? I might not completely understood the question

For a PKGBUILD I would like to use this for example


Require Java 7 or 8 but not 6 or 9


Thank you!
Today, in I have
depends=(‘java-runtime=8’) but I will change that.
Is there a good way to check the java version in the shell script too?


That is beyond my knowledge


You’ve already got a version check in the shell script. It will work fine.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.