From afa5e14e2074343270ff205e042f102c03dface0 Mon Sep 17 00:00:00 2001 From: Sky Date: Wed, 11 Dec 2013 03:54:39 +0000 Subject: Better (but unsorted) Java detection --- depends/javacheck/JavaCheck.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'depends/javacheck') diff --git a/depends/javacheck/JavaCheck.java b/depends/javacheck/JavaCheck.java index 73688082..11420b86 100644 --- a/depends/javacheck/JavaCheck.java +++ b/depends/javacheck/JavaCheck.java @@ -2,13 +2,23 @@ import java.lang.Integer; public class JavaCheck { - private static final String key = "os.arch"; + private static final String[] keys = {"os.arch", "java.version"}; public static void main (String [] args) { - String property = System.getProperty(key); - System.out.println(key + "=" + property); - if (property != null) - System.exit(0); - System.exit(1); + int ret = 0; + for(String key : keys) + { + String property = System.getProperty(key); + if(property != null) + { + System.out.println(key + "=" + property); + } + else + { + ret = 1; + } + } + + System.exit(ret); } } -- cgit v1.2.3