summaryrefslogtreecommitdiffstats
path: root/depends/javacheck
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-12-11 03:54:39 +0000
committerSky <git@bunnies.cc>2013-12-11 04:54:00 +0000
commitafa5e14e2074343270ff205e042f102c03dface0 (patch)
tree1b72b755c5b7292742b048aec4b4a77af8dec4ac /depends/javacheck
parentab69c1b9e6c25e92ded4a6ac6774e468a2e08b7b (diff)
downloadMultiMC-afa5e14e2074343270ff205e042f102c03dface0.tar
MultiMC-afa5e14e2074343270ff205e042f102c03dface0.tar.gz
MultiMC-afa5e14e2074343270ff205e042f102c03dface0.tar.lz
MultiMC-afa5e14e2074343270ff205e042f102c03dface0.tar.xz
MultiMC-afa5e14e2074343270ff205e042f102c03dface0.zip
Better (but unsorted) Java detection
Diffstat (limited to 'depends/javacheck')
-rw-r--r--depends/javacheck/JavaCheck.java22
1 files changed, 16 insertions, 6 deletions
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);
}
}