diff --git a/Rakefile b/Rakefile
index 51a7e4e..08592c2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -68,6 +68,8 @@ task :prerelease => [:clobber, :sanity_check, :test, :test_functional]
 
 task :postrelease => [:tag, :publish_docs]
 
+# don't assume it's always defined, as it requires OpenSSL
+if defined? Hoe::RubyForge
 Rake::Task[:release_to_rubyforge].clear_actions
 
 task :release_to_rubyforge do
@@ -76,6 +78,7 @@ task :release_to_rubyforge do
   rf.login
   rf.add_file hoe.rubyforge_name, hoe.rubyforge_name, hoe.version, files.first
 end
+end
 
 pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
 task pkg_dir_path do
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index 7eb755a..6154fac 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -46,6 +46,9 @@ class Gem::ConfigFile
   PLATFORM_DEFAULTS = {}
 
   system_config_path =
+    if Gem.respond_to? :system_config_path
+      Gem::system_config_path
+    else
     begin
       require 'Win32API'
 
@@ -65,6 +68,7 @@ class Gem::ConfigFile
     rescue LoadError
       '/etc'
     end
+    end
 
   SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
 
diff --git a/test/gemutilities.rb b/test/gemutilities.rb
index 63c9510..2c75319 100644
--- a/test/gemutilities.rb
+++ b/test/gemutilities.rb
@@ -469,6 +469,14 @@ Also, a list:
     RUBY_PLATFORM.match('mswin')
   end
 
+  def self.jruby?
+    RUBY_PLATFORM == "java"
+  end
+
+  def jruby?
+    RUBY_PLATFORM == "java"
+  end
+
   # Returns the make command for the current platform. For versions of Ruby
   # built on MS Windows with VC++ or Borland it will return 'nmake'. On all
   # other platforms, including Cygwin, it will return 'make'.
diff --git a/test/test_gem_ext_ext_conf_builder.rb b/test/test_gem_ext_ext_conf_builder.rb
index bc95fb1..c4a778b 100644
--- a/test/test_gem_ext_ext_conf_builder.rb
+++ b/test/test_gem_ext_ext_conf_builder.rb
@@ -14,6 +14,8 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
   end
 
   def test_class_build
+    skip("test_class_build skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_build skipped - nmake not found")
     end
@@ -50,6 +52,8 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
   end
 
   def test_class_build_extconf_fail
+    skip("test_class_build_extconf_fail skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_build_extconf_fail skipped - nmake not found")
     end
@@ -77,6 +81,8 @@ checking for main\(\) in .*?nonexistent/m, error.message)
   end
 
   def test_class_make
+    skip("test_class_make skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_make skipped - nmake not found")
     end
@@ -108,6 +114,8 @@ install:
   end
 
   def test_class_make_no_Makefile
+    skip("test_class_make_no_Makefile skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     error = assert_raises Gem::InstallError do
       Dir.chdir @ext do
         Gem::Ext::ExtConfBuilder.make @ext, ['output']
diff --git a/test/test_gem_remote_fetcher.rb b/test/test_gem_remote_fetcher.rb
index 570d2b4..c94112b 100644
--- a/test/test_gem_remote_fetcher.rb
+++ b/test/test_gem_remote_fetcher.rb
@@ -695,7 +695,6 @@ gems:
     private
 
     def start_server(port, data)
-      Thread.new do
         begin
           null_logger = NilLog.new
           s = WEBrick::HTTPServer.new(
@@ -726,7 +725,9 @@ gems:
               res['Content-Type'] = 'text/html'
             end
           }
+        Thread.new do
           s.start
+        end
         rescue Exception => ex
           abort ex.message
           puts "ERROR during server thread: #{ex.message}"
@@ -734,7 +735,6 @@ gems:
       end
       sleep 0.2                 # Give the servers time to startup
     end
-  end
 
 end