Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

javax.servlet

Options
  • 04-12-2004 5:32pm
    #1
    Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭


    I'm trying to compile a class that needs javax.* and javax.servlet but I don't have it. I have JSDK 1.5 and the newest run time but I still don't have it. Anyone know why?


«1

Comments

  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    Its part of the Apache Tomcat distrabution which you will need to run the resulting class. Servlets are web applictions that need a servlet container to run

    You can get it here
    http://apache.mirrors.esat.net/jakarta/tomcat-4/v4.1.31/bin/jakarta-tomcat-4.1.31.zip


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    I downloaded TomCat and it's still not working :(


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    is servlet.jar in your classpath when you try compile the .java file?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Eh, no...

    Where do I find it?


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    <tomcat dir>\common\lib\servlet.jar


  • Advertisement
  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    It isn't there... There's a servlet-api.jar file but that doesn't fix it :(


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    feylya wrote:
    It isn't there... There's a servlet-api.jar file but that doesn't fix it :(

    What version of tomcat is it?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    5.5


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    feylya wrote:
    5.5

    Download the one I sent you the link to (4.x).


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Nope, still not working. Here's one of the errors:
    Z:\cp300Aproj\command\HomeCommand.java:8: package javax.servlet does not exist
    import javax.servlet.* ;


  • Advertisement
  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    is servlet .jar in the CP now yeah? Are you using an IDE or the command line?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Yeah, my classpath is z:\, the .jar file is there and I'm using Textpad.


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    name the jar explictly on the command line or in the Classpath

    eg

    javac -cp .;servlet.jar HomeControl.java


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    BTW Eclpise is avery good free Java IDE


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Entered "D:\Program Files\Java\jdk1.5.0\bin\javac" -cp .;
    z:\servlet.jar z:\cp300Aproj\command\HomeCommand.java

    and got the same error...


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    still sonds like a class path error. grab eclipse and compile it in there.


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Ah, feck it. I'll deal with it in college. Thanks for the help :D


  • Registered Users Posts: 885 ✭✭✭clearz


    FFS stick this file in this folder

    JAVA_FOLDER\jre\lib\ext

    Rename the file from servlet.jar.zip to servlet.jar


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    I'm still having problems with this. I really don't know. Tomcat keeps shutting itself down to :(


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    Have a look in <tomcat dir>\logs and see if you can figure out whats up with TC.

    Post up the code and ill try compile it


  • Advertisement
  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Tomcat won't even start now. Anyone got a simple, idiot proof install guide for it?

    The code compiles grand in college but it's just missing the javax.* stuff. What sort of paths should I set for it?


  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    well if you havent compiled your code yet you dont need to be running tomcat..

    You just need the servlet jar file referenced on your classpath.
    You shouldnt need to be changing the tomcat install to compile your project.
    Concentrate on getting the code build before you start setting up the web app.


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    No, I've my code basically working, I'm bug testing now. I've a decent enough working version(barely) but it needs to be sorted out. I can't test it cos I can't get tomcat working and I can't recompile because it's missing javax :(

    And I have servlet.jar in my CLASSPATH.


  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    feylya wrote:
    No, I've my code basically working, I'm bug testing now. I've a decent enough working version(barely) but it needs to be sorted out. I can't test it cos I can't get tomcat working and I can't recompile because it's missing javax :(

    And I have servlet.jar in my CLASSPATH.
    ok, so did you have tomcat working and you broke it or did you never get it working?

    Did you compile it in college using an IDE or via command line?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Compiled in college through textpad.

    I had it half working (it ran the website until I tried to run a class file)


  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    ok, so what was different about the two environments?
    can you post a directory listing of your root project folder (where you are running javac from)?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    I have no idea how they have it set up in college.

    My directory is attached.


  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    Can you show us what files are where?
    Try putting the servlet jar into the root folder of your project then try compile it again and show us the output.
    Are you compiling in a DOS window or with a Textpad command?


  • Moderators, Music Moderators Posts: 23,361 Mod ✭✭✭✭feylya


    Well, the files were working in college with basically the same directory format. At the moment, the only problem is the Javax thingy. Once I get the sorted, Tomcat is next.


  • Advertisement
  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    feylya wrote:
    Well, the files were working in college with basically the same directory format.
    Thats the thing with computers, "basically the same" often doesnt quite cut it.
    Without seeing what you have in your project folder its pretty hard for us to help out.


Advertisement