Skip to content

Commit

Permalink
better jruby.home detection on IBM WAS
Browse files Browse the repository at this point in the history
Signed-off-by: Hiro Asari <[email protected]>
  • Loading branch information
kares authored and BanzaiMan committed Mar 24, 2012
1 parent 43e91dd commit bec227e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/jruby/embed/util/SystemPropertyCatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ public static String findJRubyHome(Object instance) {
public static String findFromJar(Object instance) {
URL resource = instance.getClass().getResource("/META-INF/jruby.home");
if (resource == null) {
return null;
// on IBM WebSphere getResource for a dir returns null but an actual
// file if it's there returns e.g. wsjar:file:/opt/IBM/WebSphere/...
// .../jruby-stdlib-1.6.7.dev.jar!/META-INF/jruby.home/bin/jrubyc
resource = instance.getClass().getResource("/META-INF/jruby.home/bin/jrubyc");
if (resource == null) return null;
}

String location = null;
Expand Down

0 comments on commit bec227e

Please sign in to comment.