Merge pull request #785 from icelimetea/reformat-javacheck

This commit is contained in:
Sefa Eyeoglu 2022-07-01 10:00:08 +02:00 committed by GitHub
commit 50f1847904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 18 deletions

View File

@ -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

View File

@ -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);
}
}