JSP is for we application development, whereas Java can be used to program stand-alone programs and/or servlets. What exactly are you trying to achieve?