Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installing JavaServer Web Development Kit

Status
Not open for further replies.

rcusr

Technical User
Sep 4, 2002
26
0
0
GB
I'm having trouble getting j2sdkee1.3.1 to work. I've downloaded and run the install for j2sdkee1.3.1.

I then set the environment vars as follows:
J2EE_HOME=C:\j2sdkee1.3.1
JAVA_HOME=C:\j2sdk1.4.1_02

and added the path:
C:\j2sdkee1.3.1\bin

But when I ran a test serverlet I got an error (listed below). Have I put the paths for the variables in wrong?

Heres the error:

C:\Documents and Settings\rcooper\My Documents\java\practise>javac ExampServlet.
java
ExampServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
ExampServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
ExampServlet.java:5: cannot resolve symbol
symbol : class HttpServlet
location: class ExampServlet
public class ExampServlet extends HttpServlet {
^
ExampServlet.java:7: cannot resolve symbol
symbol : class HttpServletRequest
location: class ExampServlet
public void doPost(HttpServletRequest request,
^
ExampServlet.java:8: cannot resolve symbol
symbol : class HttpServletResponse
location: class ExampServlet
HttpServletResponse response)
^
ExampServlet.java:9: cannot resolve symbol
symbol : class ServletException
location: class ExampServlet
throws ServletException, IOException
^
6 errors
 
I think you might have to include C:\j2sdkee1.3.1\lib\j2ee.jar as an environment variable

so you could do
javac ExampServlet -classpath c:\j2sdkee1.3.1\lib\j2ee.jar
 
I tried what you suggested but I received this error:

C:\Documents and Settings\rcooper\My Documents\java\practise>javac ExampServlet
-classpath c:\j2sdkee1.3.1\lib\j2ee.jar
javac: invalid flag: ExampServlet
Usage: javac <options> <source files>

I then added the path c:\j2sdkee1.3.1\lib\ in my environment variables... but I still received my first error when I attempted to compile?

On another forum it was suggested that I may need the servlet.jar file but I'm not sure where to put it or where to get it from.... do you know anything about this?
 
I'm really sorry I think you have to do javac ExampServlet.java -classpath c:\j2sdkee1.3.1\lib\j2ee.jar
I missed the .java bit out.....sorry
You could just do a search for the servlet.jar and then add it to your classpath as well, I don't need to add it to the classpath when I'm compiling but I may have some other environment variables set. I have a copy of servlet.jar in the Java web services developer pack from sun and that is on my classpath but I think all the servlet classes are part of the j2ee.jar?? So I don't think you need the servlet.jar unless you don't have the full j2sdkee package??
 
Thanks but I managed to get it sorted out... I didn't have the file servlet.jar, but I was recommended to download tomcat (apache server) which had the file I needed in.

Thanks anyway,


Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top