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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

javax.servlet

  • 04-12-2004 4:32pm
    #1
    Moderators, Music Moderators Posts: 23,363 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?


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,363 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,363 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,363 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,363 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,363 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,363 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,363 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,363 Mod ✭✭✭✭feylya


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


  • Registered Users, Registered Users 2 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,363 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,363 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, Registered Users 2 Posts: 27,406 ✭✭✭✭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,363 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, Registered Users 2 Posts: 27,406 ✭✭✭✭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,363 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, Registered Users 2 Posts: 27,406 ✭✭✭✭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,363 Mod ✭✭✭✭feylya


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

    My directory is attached.


  • Registered Users, Registered Users 2 Posts: 27,406 ✭✭✭✭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,363 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, Registered Users 2 Posts: 27,406 ✭✭✭✭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.


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


    Like I said, it's only the javax that's breaking the project. I've compiled the project up to this point on this machine with that directory structure.


  • Registered Users, Registered Users 2 Posts: 27,406 ✭✭✭✭GreeBo


    ok, but theres shít all I can do to help now.


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


    OK. Thanks anyway.


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


    Right, got it compiling. Downloaded the J2EE version of java. Now tomcat won't start.

    Says the JAVA_HOME path should be pointing to a SDK, not a JRE.

    Never mind, got it working. Thanks for the help.


  • Registered Users, Registered Users 2 Posts: 27,406 ✭✭✭✭GreeBo


    Hey, so are you all up and running now?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 347 ✭✭Static


    feylya wrote:
    Right, got it compiling. Downloaded the J2EE version of java. Now tomcat won't start.
    Says the JAVA_HOME path should be pointing to a SDK, not a JRE.

    Tomcat requires a compiler (hence the SDK), because part of tomcat's functionality is to compile JSP among other stuff 8)


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


    Yeah, got everything running. I had the path pointing else where, thanks to the brother's suggestions :p


Advertisement