Cage 是一个 Java 实现的验证码图片生成库,快速、小型和简单。 示例代码: 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); } fi