Java_Home issue

forgive my newsiness, but

so I just installed Jruby in a Windows Vista 32 bit box. I also
installed the latest Java SDK ie.7 u 9.

I installed the java sdk first then Jruby.

Jriuby added the Java_Home env var i.e. c:\jruby-1.7.0\jre

I then went to a new dos prompt and did the following:

Microsoft Windows [Version 6.0.6002]
Copyright © 2006 Microsoft Corporation. All rights reserved.

C:\Users\charles>jruby --version
Cannot locate Java installation, specified by JAVA_HOME:

Why is it that It can’t locate the java installation as specified by the
Jruby install i.e. that which setup the Java_Home env var ?

thanks

Charles M.
[email protected]

Charles -

I’m not sure, but until/unless someone who knows better chimes in, here
are two things I’d look into:

  1. At GettingStarted · jruby/jruby Wiki · GitHub, the example
    has a backslash at the end of the JAVA_HOME directory. Can you try
    adding a backslash and see if that helps?

  2. Is it possible JAVA_HOME was not yet set (that is, that it was
    necessary to log out and back in for it to be accessible in your DOS
    prompt)?

  • Keith

Keith R. Bennett

On Nov 21, 2012, at 9:30 AM, Charles M. [email protected]
wrote:

forgive my newsiness, but

so I just installed Jruby in a Windows Vista 32 bit box. I also installed the
latest Java SDK ie.7 u 9.

I installed the java sdk first then Jruby.

Jriuby added the Java_Home env var i.e. c:\jruby-1.7.0\jre

This could be an issue with the Installer. Does a JRE exist in that
directory?

thanks

Does the problem persist if you point JAVA_HOME to a good directory
(JRE, say)? If so, there is at least one report of this issue:
http://bugs.jruby.org/6988 (–version implies -w, I believe). For that
issue, pointing to JDK should fix the problem.

I don’t have access to a Windows machine, so I haven’t looked into it.

Keith:

  1. At GettingStarted · jruby/jruby Wiki · GitHub, the example
    has a backslash at the end of the JAVA_HOME directory. Can you try
    adding a backslash and see if that helps?

yes indeed putting in a backslash worked.

Action item: Windows installer is failing to add a backlash when
setting the Java_Home env var in Windows.

Thinking back this seems to be the same problem I had with my other
issue but instead of pointing to the JRE under Jruby on my OTHER
windows box I pointed Java_Home to the Oracle Java 1.7 u 9 directory.
That worked as well. I’m assuming that Jruby is using the latest stable
JRE ?

  1. Is it possible JAVA_HOME was not yet set (that is, that it was
    necessary to log out and back in for it to be accessible in your DOS
    prompt)?

Nope, i had made sure of that.

thanks for the feedback.

-charles