Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Try to use Ehcache from CLASSPATH before bundled.

  • Loading branch information...
commit bc6f2a9be3329b1fdc27e484d86cd6e671107262 1 parent e68d78e
Jason Voegele authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/ehcache/java.rb
13 lib/ehcache/java.rb
@@ -1,6 +1,17 @@
-module Ehcache
+require 'java'
+ # If Ehcache is already on the classpath, use it.
+ ehcache_version =
+ puts("Using Ehcache #{ehcache_version} from CLASSPATH")
+rescue NameError
+ # If not, use the Ehcache bundled with the jruby-ehcache gem.
Dir["#{Ehcache::EHCACHE_HOME}/ext/**/*.jar"].sort.each {|l| require l}
+ ehcache_version =
+ puts("Using bundled Ehcache #{ehcache_version}")
+module Ehcache
include_package 'net.sf.ehcache'
module Config

0 comments on commit bc6f2a9

Please sign in to comment.
Something went wrong with that request. Please try again.