• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem getting started

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I just wrote my first servlet but the compiler can't find the supporting J2EE 1.4 API....
It doesn't recognize any of the Servlet classes i.e. HttpServletRequest, HttpServletResponse, ServletException....

I have downloaded the J2EE1.4 bundle and set environmental variables, but I'm obviously pointing the vm down the wrong path.
Does anyone know the name of the target folder that contains the additional api code?

I already had J2sdk1.4 - the path to this is assigned to JAVA_HOME

Do I substitute this with the new path?
Can I have both, taking into consideration that the J2EE bundle also contains another copy of jdk?

Do I set the path to go to the bin directory of the server: C:\Sun\AppServer\bin
OR
set the path to the bin directory of the jdk within the J2EE bundle?
C:\Sun\Appserver\jdk\bin

I'm extremely confused

Help!
Regards, J
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just get the servlet.jar file and add it in your classpath.
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have the J2EE 1.4 bundle you should have a file called j2ee.jar in your %J2EE_HOME%\lib\ directory. Put j2ee.jar in your classpath when compiling and you'll be fine. You do not need to distribute this in your web app/ejb app when you deploy since the server you will be running on will have it's own implementation of these classes.
 
J Chandler
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ken,

hi, thanks for your comments...

I have located j2ee.jar at: C:\Sun\AppServer\lib\j2ee.jar

Put j2ee.jar in your classpath when compiling and you'll be fine.



Do you mean : cd C:\Sun\AppServer\lib
C:\Sun\AppServer\lib> javac //j2ee.jar somewhere around here?
If so, how will the compiler find my .java file?

Also, I still don't know which path to set for JAVA_HOME - leave it pointing to j2sdk1.4, or redirect?
If it's the latter, should I redirect to j2ee.jar?



J
[ August 04, 2004: Message edited by: J Chandler ]
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
read up on the differences between path and classpath and what the compiler and JVM do with each of them.
Only when you understand that you should even start thinking of doing anything involving J2EE.
 
J Chandler
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good point, well put.

Occasionally, one just needs to be grasped by the shoulders and pointed in the right direction Jeroen...

J
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic