If you use maven add this to your pom:


If you are not using maven, you have to download the jar manually from the repository and add it to your application's classpath.

Now you can generate captcha images. In this example we will generate a captcha file with "G" template.

public class QuickStart {
  public static void main(String[] args) throws IOException {
    Cage cage = new GCage();

    OutputStream os = new FileOutputStream("captcha.jpg", false);
    try {
      cage.draw(cage.getTokenGenerator().next(), os);
    } finally {

See the examples or the javadoc or read the tips to learn more.