Created
April 17, 2019 23:11
-
-
Save luisenriquecorona/d5152dc97c51f7e1f62897f13da7a9f2 to your computer and use it in GitHub Desktop.
Test for JDK >= 1.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Test for JDK >= 1.1 */ | |
public class TestJDK11 { | |
public static void main(String[] a) { | |
// Check for JDK >= 1.1 | |
try { | |
Class.forName("java.lang.reflect.Constructor"); | |
} catch (ClassNotFoundException e) { | |
String failure = | |
"Sorry, but this version of MyApp needs \n" + | |
"a Java Runtime based on Java JDK 1.1 or later"; | |
System.err.println(failure); | |
throw new IllegalArgumentException(failure); | |
} | |
System.out.println("Happy to report that this is JDK1.1"); | |
// rest of program would go here... | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment