From 7acfd0590232035879e2a08dfc5b35c37017bb68 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Wed, 06 May 2015 07:44:04 +0000
Subject: [PATCH] OPENDJ-1993 Replace outdated Java 6 references

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
index b3b66a8..faecc45 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
@@ -62,6 +62,7 @@
 import org.opends.server.util.StaticUtils;
 
 import com.forgerock.opendj.cli.ArgumentConstants;
+import com.forgerock.opendj.cli.ClientException;
 
 import static com.forgerock.opendj.cli.Utils.*;
 import static com.forgerock.opendj.util.OperatingSystem.*;
@@ -1256,21 +1257,15 @@
    */
   public static void checkJavaVersion() throws IncompatibleVersionException
   {
-    String vendor = System.getProperty("java.vendor");
-    String version = System.getProperty("java.version");
-    for (CompatibleJava i : CompatibleJava.values())
+    try
     {
-      if (i.getVendor().equalsIgnoreCase(vendor))
-      {
-        // Compare versions.
-        boolean versionCompatible = i.getVersion().compareToIgnoreCase(version) <= 0;
-        if (!versionCompatible)
-        {
-          String javaBin = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
-          throw new IncompatibleVersionException(ERR_INCOMPATIBLE_VERSION.get(i.getVersion(), version, javaBin), null);
-        }
-      }
+      com.forgerock.opendj.cli.Utils.checkJavaVersion();
     }
+    catch (ClientException e)
+    {
+      throw new IncompatibleVersionException(e.getMessageObject(), e);
+    }
+
     if (Utils.isWebStart())
     {
       // Check that the JNLP service exists.

--
Gitblit v1.10.0