sandip1981
asked on
just a simple question ...
error come up.......
C:\jdbcServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
C:\jdbcServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
Can you tell us what the question is?
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
ASKER
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......
but i dont know where to check the path......sorry i m new to this......
ASKER
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......
but i dont know where to check the path......sorry i m new to this......
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
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
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
go to a command line and type:
path
it should tell you your current set path and see is the j2ee.jar set there
ASKER
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.....
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.....
If you can't find the j2ee.jar file search for the servlet.jar and put it in your classpath.
ASKER
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??
path
and it's shows me so many other things but there is nothing related to java there......so now what should i do??
> 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>
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>
sorry ya should have said classpath
not path excuse me
not path excuse me
ASKER
hold on i m searching for jar file ......
cos i dont know whhere is the jar files r...
cos i dont know whhere is the jar files r...
so set classpath from the command line even not path
ASKER
ohh.........no..........so rry......
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.....????
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.....????
download the j2ee.jar file then or just hte servlet.jar
ASKER
from where i can download that......?
You might already have the classes. Which JDK are you using?
ASKER
i think i m usiing this.......
C:\j2sdk1.4.0_03
C:\j2sdk1.4.0_03
or here to download servlet.jar
http://java.sun.com/products/servlet/download.html
http://java.sun.com/products/servlet/download.html
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
http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/classpath.html
to find out whtat version type
java - version
from the command line
java - version
from the command line
Hm... not sure if it's there. Better to download the servlet zip file from where pronane suggested.
ASKER
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.
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.
sounds like its been corrupted or something, you should probably reinstall java full stop.
ASKER
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.....
???????
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.....
???????
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
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
it appears that you have 1.4 installed but for some reason it requires 1.3
you may have installed two versions of java on the machine
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.