cancel
Showing results for 
Search instead for 
Did you mean: 

Compiling error

Former Member
0 Kudos

Hi all,

I need to compile using command line the HelloWorldSimpleTag.java:

<i>package jsp2.examples.simpletag;

import javax.servlet.jsp.JspException;

import javax.servlet.jsp.tagext.SimpleTagSupport;

import java.io.IOException;

public class HelloWorldSimpleTag extends SimpleTagSupport {

public void doTag() throws JspException, IOException {

getJspContext().getOut().write( "Hello, world!" );

}

}</i>

I use the follow command in order to compile:

<i>javac "D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\jsp-examples\WEB-INF\classes\jsp2\examples\<b>simpletag</b>\HelloWorldSimpleTag.java"</i>

In the <b>simpletag</b> folder I inserted the javax.servlet.jsp.jar library.

But I have compiling error on: <b>package javax.servlet.jsp.jar does not exist!!!!</b>

What I wrong??? Thanks.

Vito

View Entire Topic
Former Member
0 Kudos

Vito

<i><b>Are you sure of the Class name ???</b></i>

****************************************************

package jsp2.examples.simpletag;

import javax.servlet.jsp.JspException;

import javax.servlet.jsp.tagext.<b>SimpleTagSupport</b>;

import java.io.IOException;

public class HelloWorldSimpleTag extends <b>SimpleTagSupport</b> {

public void doTag() throws JspException, IOException {

getJspContext().getOut().write( "Hello, world!" );

}

}

*******************************************

See the follwoing API : <b><a href="http://java.sun.com/products/servlet/2.2/javadoc/">API</a></b>

Thanks

Jack

<b>

Allot points if my post helps !!!</b>

Former Member
0 Kudos

Jack,

is the same: <b>package javax.servlet.jsp does not exist!!!</b>

Strange!!! Thanks,

Vito

Former Member
0 Kudos

The default class path is the current directory. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current directory in the search path, you must include "." in the new settings

Hope this helps,

Bobby

Former Member
0 Kudos

Before you compile the java class, put the servlet jar in your classpath. Since you are compiling in commandline you need to set the classpath like this

set classpath="<directory where ur servlet jar resides>;<other jar files>;;;;;;"

regards,

Sujesh