What is the proper method to reference javax.servlet on and AS/400?

I have some Java code i downloaded and i am trying to compile it on the 400.
I get "package javax.servlet does not exist"

i STRQSH, then ...

> cd /bcwjava                                                              
  $                                                                        
> ls                                                                        
  Hello.java              jqaj.txt                                          
  HelloWorldServlet.java  servlet-api-2.5.jar                              
  $                                                                        
> javac HelloWorldServlet.java                                              
  HelloWorldServlet.java:1: error: package javax.servlet does not exist    
  import javax.servlet.*;                                                  
  ^                                                                        

Here is all the Java code:
import javax.servlet.*;                                                  
import javax.servlet.http.*;                                            
import java.io.*;                                                        
public class HelloWorldServlet extends HttpServlet{                      
public void doGet (HttpServletRequest req, HttpServletResponse res)      
 throws ServletException, IOException                                    
 {                                                                      
 PrintWriter out;                                                        
 res.setContentType("text/html");                                        
 out = res.getWriter();                                                  
 out.println("<html>");                                                  
 out.println("<head><title>Hello World</title></head>");                
 out.println("<body>");                                                  
 out.println("<h1>Hello World</h1>");                                    
 out.println("</body></html>");                                          
 }                                                                      
}                                                                        

Here is how i set Java home and class path:
PGM                                                            
ADDENVVAR  ENVVAR(JAVA_HOME) +                                  
             VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk70+      
             /64bit') REPLACE(*YES)                            
ADDENVVAR  ENVVAR(CLASSPATH) +                                  
             VALUE('/qibm/ProdData/HTTP/Public/jt400/lib+      
             /jt400.jar;/qibm/ProdData/HTTP/Public/jt400+      
             /lib/jt400Servlet.jar;/bcwjava/servlet-api-+      
             2.5.jar;/qibm/ProdData/HTTP/Public/jt400/li+      
             b/jt400Native.jar') REPLACE(*YES)                  
ENDPGM
LVL 5
stevebowdoinOwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BullockQA Engineer IIICommented:
Change your classpath environment variable or specify on the java command the classpath to include the path for the jdk lib directory.
0
stevebowdoinOwnerAuthor Commented:
Change it to what?
0
Gary PattersonVP Technology / Senior Consultant Commented:
Steve, change the semicolon in your classpath to colons.  Semicolons are supported on Windows, but I think they are interpreted as part of the path on IBM i.  As a result, it can't find the servlet jar in /bcwjava.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stevebowdoinOwnerAuthor Commented:
Halleluiah
There is a greasy spot on the wall and my forehead hurts.
That fixed it.  Now I can move on.
Thanks Gary.
Steve
0
Gary PattersonVP Technology / Senior Consultant Commented:
Excellent.  Happy to help.

- Gary
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.