Compile the servlet

After you have written the source code (.java file) for your servlet, you must compile it into a .class file before you can package it for and deploy it on your iSeries server.

Compiling code on the iSeries server

Perform these steps to compile the ServletSample code:

  1. Start Qshell. On the iSeries command line, type STRQSH and press the Enter key. The QSH Command Entry screen displays. When the $ prompt displays, Qshell is ready for commands.
  2. Use the cd command to change the current directory to the directory that holds your servlet source code. On the Qshell command line, type:
    cd /path_to_mydir

    where /path_to_mydir is the fully qualified path name of your directory, and press Enter.

  3. Compile your servlet.

    On the QSH command line, type:

    javac my_servlet_name.java

    where my_servlet_name is the name of your servlet, and press the Enter key.

Alternatively, you can compile your servlet code using WebSphere Development Studio Client. For more information, see the WebSphere Development Studio Client Help.