In recent Java versions for Windows, it is recommended that
JAVA_HOME should be set in the System Variables box of Environment
Variables instead of the User Variables box.
JAVA_HOME should provide the location of the jdk rather than the jre.
Apparently, there are differences between the jre nested under the jdk
and
the non-nested jre.
For example,
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_09
would be the correct setting for the latest java update.
On our Windows 2008 server the following command stopped working
after
upgrading to jRuby 1.7.0
jruby -S rake RAILS_ENV=production daily_sync
Cannot locate Java installation, specified by JAVA_HOME:
You can get more detailed info from the JRuby launcher with:
jruby -Xtrace log.txt
That may or may not give you more hints.
–
Patrick M.
Thanks, I ran the xTrace and the only thing that looked suspicious is
jruby looks for the registry entry for JavaHome which points to the 32
bit client installed in
C:\Program Files (x86) (which is used for FireFox)
I installed the 64 bit version of jRuby with the JRE and the JAVA_HOME
points to:
c:\jruby-1.7.0\jre
This all seems ok except for the JVM stuff at end of the dump:
Someone suggested that that checking these things may help:
Cannot locate Java installation, specified by JAVA_HOME:
In recent Java versions for Windows, it is recommended that
JAVA_HOME should be set in the System Variables box of Environment
Variables instead of the User Variables box.
JAVA_HOME should provide the location of the jdk rather than the jre.
Apparently, there are differences between the jre nested under the jdk
and
the non-nested jre.
For example,
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_09
would be the correct setting for the latest java update.
On Monday, October 29, 2012 5:15:05 PM UTC, Ken E. wrote:
Cannot locate Java installation, specified by JAVA_HOME:
In recent Java versions for Windows, it is recommended that
JAVA_HOME should be set in the System Variables box of Environment
Variables instead of the User Variables box.
JAVA_HOME should provide the location of the jdk rather than the jre.
Apparently, there are differences between the jre nested under the jdk
and
the non-nested jre.
For example,
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_09
would be the correct setting for the latest java update.
This issue has been frustrating. I have tried many different
configurations and finally found one that works. What I learned in this
process is using the Oracle Java installer is problematic. One issue is
JAVA_HOME is set as Windows registry setting and I have not figured out
what is really used when running jruby, the Environment variable
JAVA_HOME or the registry setting.
I tried uninstalling the 32bit JRE7 and installing the 64bit JRE7. That
didn’t work.
What worked is I uninstalled Oracle JRE7 completely and used the JRE
that installs with jruby. To do that I set the system environment
variables:
JAVA_HOME = C:\jruby-1.7.0\jre
PATH = %JAVA_HOME%\bin + PATH
Note, our Rails application runs with WebSphere as as such none of this
impacted our application since WAS uses its own JVM.
The problem was with several Rake tasks that are invoked using the
Windows Task Scheduler.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.