aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-01 23:02:06 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-01 23:02:21 +1200
commit946c14ab4d69ac4c0742178d94f254233017034a (patch)
treee8dcc8f9619dab382375a29882eb476923da079e
parent2a34f67542221e27e64ee48928fe8fd7d59f7714 (diff)
downloadtraccar-server-946c14ab4d69ac4c0742178d94f254233017034a.tar.gz
traccar-server-946c14ab4d69ac4c0742178d94f254233017034a.tar.bz2
traccar-server-946c14ab4d69ac4c0742178d94f254233017034a.zip
Update Java version test tool
-rw-r--r--setup/java-test/README.txt2
-rw-r--r--setup/java-test/Test.java7
-rw-r--r--setup/java-test/test.jarbin829 -> 887 bytes
3 files changed, 7 insertions, 2 deletions
diff --git a/setup/java-test/README.txt b/setup/java-test/README.txt
index 95dbfcc24..b8ca72a7a 100644
--- a/setup/java-test/README.txt
+++ b/setup/java-test/README.txt
@@ -1,4 +1,4 @@
Create Java version test:
-javac -target 5 -source 5 Test.java
+javac -target 6 -source 6 Test.java
jar cfe test.jar Test Test.class
diff --git a/setup/java-test/Test.java b/setup/java-test/Test.java
index 363d6953e..7d1b3972d 100644
--- a/setup/java-test/Test.java
+++ b/setup/java-test/Test.java
@@ -1,5 +1,10 @@
public class Test {
public static void main(String[] a) {
- System.exit(Integer.parseInt(System.getProperty("java.version").split("\\.")[1]) >= 7 ? 0 : 1);
+ String[] versions = System.getProperty("java.version").split("\\.");
+ int major = Integer.parseInt(versions[0]);
+ if (major == 1) {
+ major = Integer.parseInt(versions[1]);
+ }
+ System.exit(major >= 7 ? 0 : 1);
}
}
diff --git a/setup/java-test/test.jar b/setup/java-test/test.jar
index 3afb7e312..f0484f274 100644
--- a/setup/java-test/test.jar
+++ b/setup/java-test/test.jar
Binary files differ