Skip to content

Instantly share code, notes, and snippets.

@taka2
Created August 27, 2008 14:31
Show Gist options
  • Save taka2/7489 to your computer and use it in GitHub Desktop.
Save taka2/7489 to your computer and use it in GitHub Desktop.
module Rubeus
module Helpers
def self.setup_derby
return if ENV_JAVA['java.class.path'].split(File::PATH_SEPARATOR).any?{|path| /derby[\-\.\d]*\.jar$/ =~ path}
if ENV_JAVA["java.specification.version"] == "1.6"
begin
require File.join(ENV_JAVA['java.home'], 'db', 'lib', 'derby.jar')
return
rescue LoadError
# ignore error if not installed JavaDB
# Apple's JDK doesn't include Apache Derby
end
end
puts "JavaDB is not installed."
puts "Please add derby.jar to your CLASSPATH."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment