Install gettext-0.18.1.1.tar.gz
[msysgit.git] / mingw / share / doc / gettext / examples / hello-java-qtjambi / m4 / Test15.java
blobf4bcd2c706d2b234acfd899428d32407e9fd19cb
1 // Test for Java 1.5 or newer.
2 import java.util.*;
3 public class Test15 {
4 public static void main (String[] args) {
5 try {
6 foo();
7 } catch (Throwable e) {
8 System.exit(1);
10 // Check the JVM version is at least 1.5.
11 String version = System.getProperty("java.specification.version");
12 int i = 0;
13 while (i < version.length()
14 && (Character.isDigit(version.charAt(i)) || version.charAt(i)=='.'))
15 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);
21 System.exit(0);
23 private static List<Integer> foo() {
24 return new ArrayList<Integer>();