Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    22

    Unanswered: Prerequisites for JSP. Javac donýt know javax.servlet.*

    Hello,

    I am new to Java and I want to compile with javac the following file (Test.java). I have installed JDK1.3.1 and J2SDKEE1.3.1. Then there comes the following error message:

    Test.java:1: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    2 errors

    What is the Problem? Later it should be referenced by an JSP-File.

    Flo



    ------------------------------------------

    ------ Test.java -----------



    import javax.servlet.*;

    public class Test {


    public String giveClassname() {
    return "Test test";
    }
    }
    -----------------------------------------------------





    ----------------------------------------------------
    -------------- TestJSP.jsp ----------------------


    <%@ page language="java" %>
    <%@ page import="Test" %>


    <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <title>Lomboz JSP</title>
    </head>
    <body>


    <%

    Test.giveClassname();

    out.print("TestJSP.jsp");

    %>

    </body>
    </html>

  2. #2
    Join Date
    Oct 2003
    Location
    India
    Posts
    2
    Hi

    The problem is that you don't have the required java package in the path

    you have to include the appropriate jar file(containing javax package) in the path

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •