From c47b752167c38d9088bc79b66097b5ffd817162b Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 18 Apr 2008 07:39:24 +0000
Subject: [PATCH] Fix for issue 3180 (Setup should give the path of the detected java when incorrect version is detected.)

---
 opends/src/messages/messages/quicksetup.properties          |    7 ++++---
 opends/src/quicksetup/org/opends/quicksetup/util/Utils.java |    5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/opends/src/messages/messages/quicksetup.properties b/opends/src/messages/messages/quicksetup.properties
index 7dfe4c0..2e28625 100644
--- a/opends/src/messages/messages/quicksetup.properties
+++ b/opends/src/messages/messages/quicksetup.properties
@@ -1319,6 +1319,7 @@
 MILD_ERR_ERROR_CREATING_JAVA_HOME_SCRIPTS=Error updating scripts with java \
  properties.  Error code: %d
 SEVERE_ERR_INCOMPATIBLE_VERSION=The minimum Java version required is %s.%n%n\
- The detected version is %s.%n%n\Please set OPENDS_JAVA_HOME to the root of a \
- compatible Java installation or edit the java.properties file and then run \
- the dsjavaproperties script to specify the java version to be used.
+ The detected version is %s.%nThe binary detected is %s%n%n\Please set \
+ OPENDS_JAVA_HOME to the root of a compatible Java installation or edit the \
+ java.properties file and then run the dsjavaproperties script to specify the \
+ java version to be used.
diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 06aeadd..050ec4d 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1500,8 +1500,11 @@
           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), null);
+              ERR_INCOMPATIBLE_VERSION.get(i.getVersion(), version, javaBin),
+              null);
         }
       }
     }

--
Gitblit v1.10.0