Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
This is just the jetty-hello-world program packaged as a single jar.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/main/ruby
.gitignore
README.textile
assembly.xml
pom.xml

README.textile

JRuby+Jetty+JAR Hello World

Overview

This is an example “Hello World” web application as a demonstration for bundling a JRuby application with JAR dependencies up into a single unified JAR you can run with the only deployment requirement being a working Java on your target system.

This way if you have a system that’s already running a particular JRuby release, you can “vendor all the things” and deploy an application like this without worrying about breaking anything on your server since you don’t have to muck with any existing Ruby environment, Gems, Bundler, et all.

This article helped me figure out most of the tricky bits in writing this example. So many thanks to @tomdz.

Prerequisites

OpenJDK 7u6

  1. Downloaded the package for OSX
  2. Mount it
  3. Drag the 1.7.0u6.jdk you should find to /Library/Java/JavaVirtualMachines
  4. Select the new version as the default in Java Preferences (look for it with Spotlight)

Usage

From the root of the project run:

mvn clean install

Then you can just start it up!

java -jar target/jetty-hello-world-1.0.0-SNAPSHOT.jar

Benchmarking

To benchmark I run this:

httperf --num-conns=50 --num-calls=2000 --port 9292

After warm-up the second time I get over 7,000 requests per second.

Something went wrong with that request. Please try again.