Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

just a simple question ...

Posted on 2003-03-18
31
Medium Priority
?
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

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 35

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 35

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 35

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 35

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 35

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 …
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 explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

705 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