@@ -0,0 +1,1256 @@
+/*%0A * Copyright (C) 2021 DiffPlug%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     https://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.diffplug.gradle.eclipserunner;%0A%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Aclass JreVersion %7B%0A%09public static int thisVm() %7B%0A%09%09String jre = System.getProperty(%22java.version%22);%0A%09%09if (jre.startsWith(%221.8%22)) %7B%0A%09%09%09return 8;%0A%09%09%7D else %7B%0A%09%09%09Matcher matcher = Pattern.compile(%22(%5C%5Cd+)%22).matcher(jre);%0A%09%09%09if (!matcher.find()) %7B%0A%09%09%09%09throw new IllegalArgumentException(%22Expected %22 + jre + %22 to start with an integer%22);%0A%09%09%09%7D%0A%09%09%09int version = Integer.parseInt(matcher.group(1));%0A%09%09%09if (version %3C= 8) %7B%0A%09%09%09%09throw new IllegalArgumentException(%22Expected %22 + jre + %22 to start with an integer greater than 8%22);%0A%09%09%09%7D%0A%09%09%09return version;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add the ability to calculate JRE version.