arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

RJB does not support switching on JVMs o OSX via JAVA_HOME #12

Closed realityforge closed 12 years ago

realityforge commented 12 years ago

The Buildr project (buildr.apache.org) uses RJB to launch the JVM from within the build process. As Java 1.7 becomes more popular people are wanting to switch between JVMs by simply changing the JAVA_HOME variable to point at new JVM and this works on all the platforms except OSX.

I looked at the 1.7 JVM under OSX and it seems to be in a completely different directory structure from the older Apple based JVMs (now it seems to match Linux/Windows directory layout).

Is it likely to be difficult to update RJB to support this new JVM? Is there any demand for it? Is it in the pipeline?

arton commented 12 years ago

I think that it can be solved by JVM_LIB environment variable, that introduced for swich between client vm and server vm. Rjb initially looks JVM_LIB for specifying JVM exactly.

So before requiring rjb, you may set it by checking JAVA_HOME.

cf.)https://gist.github.com/3840535

Hope this help.

realityforge commented 12 years ago

Works like a charm. Thanks!

arton commented 12 years ago

Thank you for your report.

I will add the feature into rjb.rb (not rjbcore.so) in next Gem if OSX && !JAVA_HOME && !JVM_LIB => default behaviour for OSX. But the code in gist:3840535 is comaptible with that. So I wonder if you can include the setting in your script.