You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TFTP/Java/src/mains/Driver.java
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
packagemains;
2
2
3
3
importjava.io.IOException;
4
+
importjava.util.Properties;
4
5
importjava.util.Scanner;
5
6
6
7
importjavax.swing.JOptionPane;
@@ -18,6 +19,19 @@ public class Driver {
18
19
privatestaticControllerc;
19
20
publicstaticvoidmain(String[] args){
20
21
u = newUtility();
22
+
23
+
Propertiesp = System.getProperties();
24
+
Stringjre = p.getProperty("java.version");
25
+
26
+
if(jre.contains("."))
27
+
jre = jre.substring(0,jre.indexOf('.'));
28
+
29
+
if(Integer.parseInt(jre) < 17) {
30
+
intans = newGUI().confirmDialog("The program was not tested for the version of Java installed (version " + jre + ").\nProgram requires at least Java 17.\nDo you want to continue?", "Java Compatibility Check", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
31
+
if(ans == JOptionPane.NO_OPTION)
32
+
exit(0);
33
+
}
34
+
21
35
try {
22
36
if(args.length > 0) {
23
37
for(Stringa: args) {
@@ -29,7 +43,7 @@ public static void main(String[] args){
29
43
Console();
30
44
if(a.equals("-T") || a.equals("--testing")) {
31
45
System.out.println("THIS FUNCTION IS DEPRECATED!\nEXITING...");
32
-
System.exit(0);
46
+
exit(0);
33
47
Testing();
34
48
}
35
49
if(a.equals("-P") || a.equals("--production"))
@@ -41,7 +55,7 @@ public static void main(String[] args){
0 commit comments