Merge pull request #785 from icelimetea/reformat-javacheck
This commit is contained in:
commit
50f1847904
@ -4,7 +4,7 @@ find_package(Java 1.7 REQUIRED COMPONENTS Development)
|
||||
|
||||
include(UseJava)
|
||||
set(CMAKE_JAVA_JAR_ENTRY_POINT JavaCheck)
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS -target 8 -source 8 -Xlint:deprecation -Xlint:unchecked)
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS -target 7 -source 7 -Xlint:deprecation -Xlint:unchecked)
|
||||
|
||||
set(SRC
|
||||
JavaCheck.java
|
||||
|
@ -1,24 +1,25 @@
|
||||
import java.lang.Integer;
|
||||
public final class JavaCheck {
|
||||
|
||||
public class JavaCheck
|
||||
{
|
||||
private static final String[] keys = {"os.arch", "java.version", "java.vendor"};
|
||||
public static void main (String [] args)
|
||||
{
|
||||
int ret = 0;
|
||||
for(String key : keys)
|
||||
{
|
||||
private static final String[] CHECKED_PROPERTIES = new String[] {
|
||||
"os.arch",
|
||||
"java.version",
|
||||
"java.vendor"
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
int returnCode = 0;
|
||||
|
||||
for (String key : CHECKED_PROPERTIES) {
|
||||
String property = System.getProperty(key);
|
||||
if(property != null)
|
||||
{
|
||||
|
||||
if (property != null) {
|
||||
System.out.println(key + "=" + property);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = 1;
|
||||
} else {
|
||||
returnCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
System.exit(ret);
|
||||
|
||||
System.exit(returnCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user