I. Question Today, I have to be a website login verification code. I use JSP. Dynamic generates a picture. The above contains four numbers to prevent the invasion procedure from trying to log in. The program has no problem under Windows, but the application is deployed to Solaris. Program reference image.jsp, error as follows: java.lang.noclassdeffounderror at java.lans.class.Forname0 (Native method) at java.lang.class.Forname (Class.java: 130) at java.awt.graphicsenvironment. getLocalGraphicsEnvironment (GraphicsEnvironment.java:62) at java.awt.image.BufferedImage.createGraphics (BufferedImage.java:1053) at java.awt.image.BufferedImage.getGraphics (BufferedImage.java:1043) at org.apache.jsp.image $ JSP._JSPSERVICE (Image $ JSP.JAVA: 119) II. Solve some online information, it turns out that this is a bug of Java. Due to a shortcoming of the Java language itself, under the Soloris platform (there is no this in the Windows platform Question, unclear under Linux platform) It is not possible to directly reference 2D, 3D system graphics platform related packages. In order to solve the above problem, you need to modify the Catalina.sh in Tomcat, add the following two lines: ###################################################################################################################################################################################################################################################################### ################################## = / usr / j2se / JRE / lib / fonts ################################################################################################################################################################################################################################################################################################# ############### I just added the -Djava.awt.headless = true when I actually use it, add it to every place of starting Java, as follows shown: $ JAVA_HOME / bin / java $ JAVA_OPTS $ CATALINA_OPTS -classpath $ CP / -Djava.security.manager / -Djava.awt.headless = true / -Djava.security.policy == $ CATALINA_BASE / conf / catalina.policy / -Dcatalina.base = $ catalina_base / -dcatalina.home = $ catalina_home / org.apache.catalina.startup.bootstrap "$ @" start / with -djava.awt.Headless = true This parameter replaces the designation of Display. Note: This requires a certain version of Java support. III. Reference article http://bbs.chinaunix.net/forum/6/20040810/38399.htmlhttp://blog.9cbs.net/freeknightlcw/archive/2004/11/15/182382.aspx (color verification code Source code)