Better (but unsorted) Java detection
This commit is contained in:
parent
ab69c1b9e6
commit
afa5e14e20
13 changed files with 338 additions and 87 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue