Skip to content

Commit 9d2ff47

Browse files
committed
Merge pull request #4 from timhayman/master
Fix JRUBY-7096 JAVA_HOME value corrupted. Thanks for the PR Tim.
2 parents 3ee9de2 + 0d0a9e7 commit 9d2ff47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platformlauncher.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ bool PlatformLauncher::checkJDKHome() {
220220
logMsg("-Xjdkhome is not set, checking for %%JAVA_HOME%%...");
221221
char *origJavaHome = getenv("JAVA_HOME");
222222
if (origJavaHome) {
223-
const char *javaHome = trimTrailingBackslashes(origJavaHome).c_str();
224-
logMsg("%%JAVA_HOME%% is set: %s", javaHome);
225-
if (!jvmLauncher.initialize(javaHome)) {
226-
logMsg("ERROR: Cannot locate java installation, specified by JAVA_HOME: %s", javaHome);
223+
string javaHome = trimTrailingBackslashes(origJavaHome);
224+
logMsg("%%JAVA_HOME%% is set: %s", javaHome.c_str());
225+
if (!jvmLauncher.initialize(javaHome.c_str())) {
226+
logMsg("ERROR: Cannot locate java installation, specified by JAVA_HOME: %s", javaHome.c_str());
227227
string errMsg = "Cannot locate Java installation, specified by JAVA_HOME:\n";
228228
errMsg += javaHome;
229229
string errMsgFull = errMsg + "\nDo you want to try to use default version?";

0 commit comments

Comments
 (0)