Assemble the application: Compile the enterprise bean files
After you copy the source code files for your sample application, compile the enterprise bean files into .class files. You must compile the enterprise bean files before you compile the servlet, because the servlet refers to the enterprise bean files.
Follow these steps to compile the code:
Enter the Start Qshell (STRQSH) command on an OS/400 command line.
Set the classpath to include the J2EE classes, which are contained in the j2ee.jar file. Enter this command:
export -s CLASSPATH=.:/QIBM/ProdData/WebAS5/Base/lib/j2ee.jarOn the QSH command line, enter this command:
cd /hcsampleCompile the enterprise bean files. Enter this command:
javac /hcsample/com/ibm/defaultapplication/*.java
Troubleshooting
If your code compiles with errors, check if the correct Java version is being used. On the Qshell command line, enter this command:
java -versionIf it does not indicate the JDK 1.3.x level, you need to explicitly specify the version to use when compiling by entering this command:
javac -J-Djava.version=1.3 /hcsample/com/ibm/defaultapplication/*.javaIf you still have compilation errors after checking your Java version, check your classpath. On a Qshell command line, enter this command:
echo $CLASSPATHThe correct classpath is .:/QIBM/ProdData/WebAS5/Base/lib/j2ee.jar. The first period refers to the current directory, and /QIBM/ProdData/WebAS5/Base/lib/j2ee.jar refers to the J2EE APIs.