File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/main/java/com/testingbot/tunnel Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,27 @@ private static Float getVersionFromProperties() {
7272 return 0.0f ;
7373 }
7474
75+ private static final int MINIMUM_JAVA_VERSION = 11 ;
76+
77+ static boolean checkJavaVersion () {
78+ int major = getMajorJavaVersion ();
79+ if (major < MINIMUM_JAVA_VERSION ) {
80+ System .err .println ("Error: TestingBot Tunnel requires Java " + MINIMUM_JAVA_VERSION + " or higher." );
81+ System .err .println ("Current version: " + Runtime .version ());
82+ System .err .println ("Please upgrade your Java installation and try again." );
83+ return false ;
84+ }
85+ return true ;
86+ }
87+
88+ static int getMajorJavaVersion () {
89+ return Runtime .version ().feature ();
90+ }
91+
7592 public static void main (String ... args ) throws Exception {
93+ if (!checkJavaVersion ()) {
94+ System .exit (1 );
95+ }
7696
7797 final CommandLineParser cmdLinePosixParser = new PosixParser ();
7898 final Options options = new Options ();
You can’t perform that action at this time.
0 commit comments