Though there seem to be a bunch of questions and answers related to setting the JAVA_HOME variable in Windows, I am not entirely sure where I am going wrong.
I've followed all sorts of different instructions on setting the environment variable, and when I check the environment variable in ruby I get
c:\Ruby192>rib irb(main):001:0> puts ENV['JAVA_HOME'] "c:\progra~1\java\jdk1.6.0_20" => nil
So I have been interpreting this as the environment variable being set , as the path to my jdk is returned, but what is the 'nil'??
echo %JAVA_HOME%
also returns the path to my jdk.
When I run
gem install rjb
I get
extconf.rb:39:in '(main)': JAVA_HOME is not a directory. (RuntimeError)
When I look in the extconf.rb file, sure enough, I've got
javahome = ENV['JAVA_HOME'] if javahome.nil? && RUBY_PLATFORM =~ /darwin/ javahome = `/usr/libexec/java_home`.strip end unless javahome.nil? if javahome[0] == ?" && javahome[-1] == ?" javahome = javahome[1..-2] end raise "JAVA_HOME is not directory." unless File.directory?(javahome) pt = Path.new
So from what I can tell, either the nil means that JAVA_HOME isn't being found, or I'm not pointing it to the right path or something.
I've tried including the '\bin' to the end of the path, as some responses said that was necessary, but I get the same result.
Any suggestions?