Simplified Java distribution

Change-Id: I86736cb37722698bc6c205cc8ac3d524d7ca37fc
diff --git a/bin/git_gerrit_pull b/bin/git_gerrit_pull
index 9492f61..41d74d6 100755
--- a/bin/git_gerrit_pull
+++ b/bin/git_gerrit_pull
@@ -6,6 +6,14 @@
 
 our @ARGV;
 
+my $JAVA8_HOME  = '/usr/lib/jvm/java-1.8.0-openjdk-amd64';
+my $JAVA11_HOME = '/usr/lib/jvm/java-1.11.0-openjdk-amd64';
+my $JAVA17_HOME = '/usr/lib/jvm/java-1.17.0-openjdk-amd64';
+
+if (-d $JAVA17_HOME) {
+  $JAVA17_HOME = '/opt/java/jdk-17.0.2';
+};
+
 my $url = $ARGV[0];
 
 sub _check {
@@ -48,21 +56,20 @@
 _check('git checkout ' . $branch);
 _check('git rebase master');
 
-my $JAVA17_HOME="/opt/java/jdk-17.0.2";
 
 # Kustvakt
 if ($project =~ m!^Kustvakt$!i) {
-  _check('cd full && JAVA_HOME='.$JAVA17_HOME.' mvn clean test');
+  _check('cd full && JAVA_HOME="'.$JAVA17_HOME.'" mvn clean test');
 }
 
 # KalamarExport-Plugin
 elsif ($project =~ m!^Kalamar-Plugin-Export$!i) {
-  _check('JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64" mvn clean test');
+  _check('JAVA_HOME="'.$JAVA8_HOME.'" mvn clean test');
 }
 
 # Koral
 elsif ($project =~ m!^Koral$!i) {
-  _check('JAVA_HOME="/usr/lib/jvm/java-1.11.0-openjdk-amd64" mvn clean test');
+  _check('JAVA_HOME="'.$JAVA11_HOME.'" mvn clean test');
 }
 
 # Kalamar-Plugin-ExternalResources
@@ -72,10 +79,15 @@
 
 # KorapSRU
 elsif ($project =~ m!^KorapSRU$!i) {
-  _check('JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64" mvn clean test');
+  _check('JAVA_HOME="'.$JAVA8_HOME.'" mvn clean test');
 }
 
-# KorapSRU
+# Korap-Tokenizer
+elsif ($project =~ m!^KorAP-Tokenizer$!i) {
+  _check('JAVA_HOME="'.$JAVA8_HOME.'" mvn clean test');
+}
+
+# Datok
 elsif ($project =~ m!^Datok$!i) {
   _check('make test');
 }