If you have a look at the detailed installation instructions then there is a section for general purpose java applications. That is your case.
The following are the jars from the dependencies folder required for general purpose Java 5 applications (or a newer compatible version of each dependency):
- google-api-client-1.17.0-rc.jar
- google-oauth-client-1.17.0-rc.jar
- google-http-client-1.17.0-rc.jar
- commons-logging-1.1.1.jar
- gson-2.1.jar httpclient-4.0.3.jar
- httpcore-4.0.1.jar
- jackson-core-2.1.3.jar
- jsr305-1.3.9.jar
- protobuf-java-2.2.0.jar
- xpp3-1.1.4c.jar
You can use the GooglePromptReceiver to ask the end user to paste the authorization code from the browser to your application. You can find examples in the samples. The cmdline samples apply to your case.