1 // Test for Java 1.5 or newer.
4 public static void main (String
[] args
) {
7 } catch (Throwable e
) {
10 // Check the JVM version is at least 1.5.
11 String version
= System
.getProperty("java.specification.version");
13 while (i
< version
.length()
14 && (Character
.isDigit(version
.charAt(i
)) || version
.charAt(i
)=='.'))
16 float fversion
= Float
.valueOf(version
.substring(0,i
));
17 if (!(fversion
>= 1.5f
)) System
.exit(1);
18 // Check the VM is not GNU libgcj.
19 String vm
= System
.getProperty("java.vm.name");
20 if (vm
.startsWith("GNU")) System
.exit(1);
23 private static List
<Integer
> foo() {
24 return new ArrayList
<Integer
>();