getting selenium working with jruby/sinatra/cucumber/webrat on windows

I am trying to run cucumber/webrat with Sinatra on Jruby 1.7.3 (1.9.3) on Windows. It seems to work ok, but when I try to add selenium to webrat. I get the error shown below. It seems like it thinks it is in a linux environment or something as the error happens when it tries to start selenium server and there is a “&” at the end of the argument chain. I took a look at capybara but had some other similar incomprehensible problem there where the stack dump seemed to go on for ever until it ran out of memory. I just want a way to test the javascript aspects of the sinatra server content.

features/support/env.rb

ENV['RACK_ENV'] = 'test'

require 'rubygems'
require 'rack/test'
require 'rspec/expectations'
require 'webrat'
require "selenium/client"

require File.join(File.dirname(__FILE__), '../../', 'main.rb')


Webrat.configure do |config|
# config.mode = :rack
  config.mode = :selenium
  config.application_port = 4567
  config.application_framework = :sinatra
end

class WebratMixinExample
  include Rack::Test::Methods
  include Webrat::Methods
  include Webrat::Matchers

  Webrat::Methods.delegate_to_session :response_code, :response_body

  def app
    # Sinatra::Application
    Main     
  end
end

World{WebratMixinExample.new}