I worked with Ketan Padegaonkar on creating a wrapper around the JDT compiler.
Usually, you would call it by installing the compiler jar, and reference it while calling the java compiler:
java -classpath org.eclipse.jdt.core_3.2.0.jar org.eclipse.jdt.internal.compiler.batch.Main -classpath rt.jar A.java
Granted ruby and rubygems are installed on your system, installing JDTc is easy:
sudo gem install jdtc
JDTc installs the compiler for you, and places it at a convenient location. Then running the JDT compiler is a bit easier:
jdtc -classpath rt.jar A.java
A bit easier, hey ?