Improve company productivity with a Business Account.Sign Up

x
?
Solved

just a simple question ...

Posted on 2003-03-18
31
Medium Priority
?
169 Views
Last Modified: 2010-03-31
error come up.......
C:\jdbcServlet.java:2: package javax.servlet does not exist

import javax.servlet.*;
0
Comment
Question by:sandip1981
  • 15
  • 10
  • 5
  • +1
31 Comments
 

Expert Comment

by:rwoodruf
ID: 8160194
Can you tell us what the question is?
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160235
Check that the path to j2ee.jar is available to the file that you are trying to compile, that comes up because the compiler cant find the javax.servlet
0
 

Author Comment

by:sandip1981
ID: 8160253
yeah i come to know that error is cos of compiler cant find the javax.servlet.....
but i dont know where to check the path......sorry i m new to this......
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 

Author Comment

by:sandip1981
ID: 8160261
yeah i come to know that error is cos of compiler cant find the javax.servlet.....
but i dont know where to check the path......sorry i m new to this......
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160367
where have you set the path,

lets say you have j2ee.jar in c:\temp
your path might look something like this;

set path = c:\jdk1.4.1\bin;

just do this ( not sure if comma afterwards or not so try out a few )

set path = c:\jdk1.4.1\bin; c:\temp\j2ee.jar
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160374
type path at the commandline you can also set path at the command line

go to a command line and type:

path

it should tell you your current set path and see is the j2ee.jar set there
0
 

Author Comment

by:sandip1981
ID: 8160379
the question is when i m tryting to run my java program.......
it's give me the above error.. i found that error is cos of compiler can not find the import javax.servlet so what i think is if i set the path .....that should work .....but the thing is i dont know how to set the path to import javax.servlet...... and other reason may be is i dont have install that import classes..... so i even neeed to know from where i can download that classes... and with that i m also looking for java docs.....i mean the api so that i can see offline all calsees and interface....thx in advance.....
0
 
LVL 36

Expert Comment

by:girionis
ID: 8160386
 If you can't find the j2ee.jar file search for the servlet.jar and put it in your classpath.
0
 

Author Comment

by:sandip1981
ID: 8160404
okey i type on my command line
path
and it's shows me so many other things but there is nothing related to java there......so now what should i do??
0
 
LVL 36

Expert Comment

by:girionis
ID: 8160409
> but the thing is i dont know how to set the path to import javax.servlet

  You do not ned to set the path... You path is already set up. You need to set up the classpath. To do it you need to do:

set CLASSPATH=<path to the file with the servlet classes>

or (Unix/Linux)

export CLASSPATH=<path to the file with the servlet classes>

  or you coudl even do:

javac -classpath <path to the file with the servlet classes> <YourServlet.java file here>
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160439
sorry ya should have said classpath
not path excuse me
0
 

Author Comment

by:sandip1981
ID: 8160443
hold on i m searching for jar file ......
cos i dont know whhere is the jar files r...
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160444
so set classpath from the command line even not path
0
 

Author Comment

by:sandip1981
ID: 8160465
ohh.........no..........sorry......
i search for *.jar files in my computer
and that listed me aobut 100 jar files......
but in that there is no j2ee.jar or servlet.jar file.....
now what.....to do.....????
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160483
download the j2ee.jar file then or just hte servlet.jar
0
 

Author Comment

by:sandip1981
ID: 8160487
from where i can download that......?
0
 
LVL 36

Expert Comment

by:girionis
ID: 8160488
 You might already have the classes. Which JDK are you using?
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160507
go hear to download j2ee.jar

http://java.sun.com/j2ee/download.html
0
 

Author Comment

by:sandip1981
ID: 8160509
i think i m usiing this.......

C:\j2sdk1.4.0_03


0
 
LVL 1

Expert Comment

by:pronane
ID: 8160524
or here to download servlet.jar
http://java.sun.com/products/servlet/download.html
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160531
not to get outdone try this page for help on setting the classpath also:

http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/classpath.html
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160540
to find out whtat version type

java - version
from the command line
0
 
LVL 36

Expert Comment

by:girionis
ID: 8160561
  Hm... not sure if it's there. Better to download the servlet zip file from where pronane suggested.
0
 

Author Comment

by:sandip1981
ID: 8160564
C:\>java -version
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.4', but '1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160628
sounds like its been corrupted or something, you should probably reinstall java full stop.
0
 

Author Comment

by:sandip1981
ID: 8160651
i m so much confused..........now.......
i dont even understand in this java.com that how to download j2ee.jar.......or servlet.jar........
sorry......but i m new to this...... k
now......to reinstill java full.....what do i do....
do i need to download that from somewhere.....
???????
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160672
to download the latest jdk i.e the latest version of java go to thsi site and download depending on your OS etc:
http://java.sun.com/j2se/1.4.1/download.html

to download the j2ee.jar go to the previous site i said.  

to set the classpath once you have both done look at the previous link i posted about setting the path or look at girinois' example
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160683
it appears that you have 1.4 installed but for some reason it requires 1.3
0
 
LVL 1

Expert Comment

by:pronane
ID: 8160689
you may have installed two versions of java on the machine
0
 
LVL 36

Accepted Solution

by:
girionis earned 120 total points
ID: 8160990
 I suggest you completely uninstall them and install a fresh copy. If the error persists please ask again. There are ways of getting rid of it although it requires manually changing the registry.
0
 
LVL 1

Assisted Solution

by:pronane
pronane earned 80 total points
ID: 8181248
sandip1981  did you try what we suggested? how did it go?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

584 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question