Home Tutorialhelp Comment classpath setting

 
 

Comment

aleem
classpath setting,
October 8, 2009 at 1:36 PM

tomcat-5.0.2 has installed on my laptop. i've set my environment variable to F:\tomcat-5.0.2\common\lib\servlet-api.jar, "javac myfile.java" has i executed & success, but i have a trouble while i run "java myfile". where's my foul?is it any other way to set my classpath so i can learn servlet easily?

this is the source code :

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SalamKeadilanServlet extends HttpServlet
{
public void service(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("Salam keadilan !");
out.println("</body></html>");
}
}

error message :

exception in thread "main" java.lang.NoSuchMethodError: main
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

JAVA CLASSPATH PROBLEM
JAVA CLASSPATH PROBLEM  hi all Friends I am stuck using the java servlets and problem raise for classpath. I had a problem with servlet to call... solved this problem by putting the path of classes to the classpath 

Java Beginners

setting classpath of tomcat - Java Beginners
setting classpath of tomcat  hello i am giri. I Installed the Tomcat6 in my system and the problem is, How to set the classpath, Please give...;System->Environment Variables-> and set the CLASSPATH C:\Program Files 

Java Beginners

Classpath - Java Beginners
Java classpath setting command line  Is there any command line to set the classpath in Java 

Java Technology Tutorials

Java ClassPath
. i.e.classpath  C:\Java\jdk1.6.0_03\lib For setting CLASSPATH using... when calling an SDK tool (the preferred method) or by setting the CLASSPATH... there is a `Control Panel' page for this. Setting the system CLASSPATH is a useful 

Struts Questions

classpath and path for structs1.3.8
classpath and path for structs1.3.8  How to set classpath and path for structs1.3.8 ?   just add struts-core-1.3.8.jar file to CLASSPATH........there is no need of setting path 

Development process Questions

Servlets
the classpath? It seems that there may be something missing in servlet configuration. Anyways, please visit the following links: http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http://www.roseindia.net/servlets 

Java Beginners

CLasspath
CLasspath  what is classpath?   The <B>Classpath... and packages when running Java programs.   Hi Friend, Classpath.... In CLASSPATH environment you need to specify only .class files (i.e., jar, zip files 

Java Beginners

CLasspath
CLasspath  what is classpath?   Hello, Classpath is Environment Variable that tells JVM or Java Tools where to find the classes. In CLASSPATH environment you need to specify only .class files (i.e., jar, zip files 

JSP Servlet Questions

Set classpath and "commons-fileupload.jar" - JSP-Servlet
)..where should i place it, and also confuse at the setting classpath, please guide...Set classpath and "commons-fileupload.jar"  Hi, Thanks... Files\Apache Software Foundation\Tomcat 5.0\" After set the classpath 

Ant Questions

problem in setting path - Ant
problem in setting path  hi friends i am getting a problem in setting... Do some changes setting the path : 1)ANT_HOME=D:\installations\apache...; Remove the ".;" at the end 3)You have not mention classpath : set 

Java Beginners

Setting of java1.4.2 path
Setting of java1.4.2 path  Hello I have uploaded java1.4.2 into my laptop and i have done path settings for System variabales as Path (C:\j2sdk1.4.2\bin) and classpath(C:\j2sdk1.4.2\lib) .But when i write simple 

JSP Servlet Questions

variable setting for servlet - JSP-Servlet
variable setting for servlet  how to set environment variable and class path variable for servlet and to compile servlet files i am using tomcat...://www.roseindia.net/servlets/HowToRunAServlet.shtml http://www.roseindia.net/servlets 

Java Interview Questions

Java classpath
Java classpath  What is the difference between classpath and path variable 

Java Beginners

path classpath
path classpath  EXPLAIN PATH AND CLASSPATH ? DIFF send me ans plz.  ... be in path. While Classpath is Enviroment Variable that tells JVM or Java Tools where 

JSP Servlet Questions

Servlets Program
Servlets Program  Hi, I have written the following servlet: [code] package com.nitish.servlets; import javax.servlet.*; import java.io.*; import... the classpath for ojdbc14.jar prior to compilation. And instead of using blob object 

Java Beginners

setting path problem for org.jfree files - Java Beginners
setting path problem for org.jfree files  Hi deepak, As u said, i... with org.jfree files and i have given the classpath as folllows... C:\Program Files... org.jfree and so on........after setting the path, i have restarted my system also 

Struts Questions

STRUCT CLASSPATH - Struts
STRUCT CLASSPATH  What is the STRUCT CLASSPATH 

JDBC Questions

Installing the Driver and Configuring the CLASSPATH
Installing the Driver and Configuring the CLASSPATH  What is the procedure to Installing the Driver and Configuring the CLASSPATH mysql jdbc connector? the jar file 

Java Beginners

running java with classpath in cygwin
running java with classpath in cygwin  The following command works in cmd.exe but failts in cygwin shell. java -cp .;oracle.jar;mysql.jar Executecmd query value; how should i alter the command to run in the bash shell?thanks 

Servlet Interview Questions

servlets
servlets  what is the duties of response object in servlets 

Servlet Interview Questions

servlets
servlets  why we are using servlets 

Servlet Interview Questions

servlets
what are advantages of servlets  what are advantages of servlets   Please visit the following link: Advantages Of Servlets 

JSP Servlet Questions

Servlets
Servlets  How to edit and delete a row from the existing table in servlets 

Servlet Interview Questions

servlets
servlets  How do you communicate between the servlets?   We can communicate between servlets by using RequestDespatcher interface and servlet chaining 

Servlet Interview Questions

servlets
what is the architecture of a servlets package  what is the architecture of a servlets package   The javax.servlet package provides interfaces and classes for writing servlets. The Servlet Interface The central 

JSP Servlet Questions

Servlets
Servlets  How to check,whether the user is logged in or not in servlets to disply the home page 

Java Interview Questions

servlets
servlets  why we require wrappers in servlets? what are its uses? Please explain   These wrappers classes help you to modify request...://www.roseindia.net/servlets/response-filte.shtml 

JSP Servlet Questions

servlets
servlets  How to open and read the contents of a text file in servlets?   Please visit the following link: Read text file using Servlet 

JSP Servlet Questions

servlets
servlets   Hi what is pre initialized servlets, how can we achives?   When servlet container is loaded, all the servlets defined in the web.xml file does not initialized by default. But the container receives 

WebSevices Questions

Servlets and
Servlets and   Sir...! I want to insert or delete records form oracle based on the value of confirm box can you please give me the idea.... thanks 

Servlet Interview Questions

servlets
servlets why do we need web-inf directory in web application  why do we need web-inf directory in web application? means what's the benefits of doing so 

JSP Servlet Questions

Servlets - JSP-Servlet
and save into tomcat/lib folder and set the classpath. For more information 

Servlet Interview Questions

servlets
which are the differ ways you can communicat between servlets  which are the differ ways you can communicat between servlets   Different ways of communicating between servlets:- 1)Using RequestDispatcher object. 2 

Servlet Interview Questions

servlets
package supports the development of servlets that use the HTTP protocol. The classes... javax.servlet.GenericServlet and serves as the base class for HTTP servlets. HttpServlet-Request 

Servlet Interview Questions

servlets
what are sessions in servlets  what are sessions in servlets   A Session refers to all the request that a single client makes to a server...: http://roseindia.net/jsp/jspsession/ http://www.roseindia.net/servlets 

Servlet Interview Questions

the servlets
what is diff between generic servlets and httpservlets  what is diff between generic servlets and httpservlets   Difference between GenericServlet and HTTPServlet: 1)GenericServlet belongs to javax.servlet package 

Servlet Interview Questions

servlets
regarding the user usage and habits. Servlets sends cookies to the browser client...://www.roseindia.net/jsp/jspcookies.shtml http://www.roseindia.net/servlets/use 

JSP Servlet Questions

servlets
servlets  hi i am using servlets i have a problem in doing an application. in my application i have html form, in which i have to insert on date value, this date value is retrieved as a request parameter in my servlet 

Java Beginners

What is difference between Path and Classpath?
What is difference between Path and Classpath?   hi What is difference between Path and Classpath? thanks   Hi, The Path & Classpath are used for operating system level environment variales. We mostly use Path 

Servlet Interview Questions

servlets
what are filters in java servlets  what are filters in java   Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm 

Servlet Interview Questions

servlets
servlets  what are different authentication options available in servlets   There are four ways of authentication:- HTTP basic authentication HTTP digest authentication HTTPS client authentication Form-based 

JSP Servlet Questions

servlets output to jsp - JSP-Servlet
servlets output to jsp  hey i have writing a code lately and wanted to print the output to the jsp page from the servlet.the servlet would read...]; Process p = Runtime.getRuntime().exec ("java -classpath /home/muzammil/apache 

Servlet Interview Questions

SERVLETS
 

JSP Servlet Questions

servlets
 

JSP Interview Questions

servlets
 

Servlet Interview Questions

the servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

servlets
 

Servlet Interview Questions

the servlets
 

Java Beginners

servlets
 

Java Beginners

servlets
 

Servlet Interview Questions

servlets
 

Java Beginners

Servlets
 

Java Interview Questions

servlets
 

Development process Questions

Servlets
 

Development process Questions

Servlets
 

Development process Questions

Servlets
 

Development process Questions

SERVLETS
 

Development process Questions

Servlets
 

Development process Questions

Servlets
 

Development process Questions

Servlets
 

Development process Questions

SERVLETS
 

JSP Servlet Questions

servlets
 

JSP Servlet Questions

servlets
 

JSP Servlet Questions

Servlets
 

Java Server Faces Questions

Servlets
 

JSP Servlet Questions

Servlets
 

Java Beginners

java classpath prbm in windows 7
java classpath prbm in windows 7  i have a problem to set the classpath in windows7 in my system oracle is not there. environment variables under that user variables i set them like this: CLASS .;C:\Program Files\Java\jdk1.6.0_32 

JavaScript Questions

setting keys
setting keys  Hi Sir\Mam,At present we are doing Payroll Project .I would like to set some special keys for my forms and i want the coding to do the same .Pls Provide me source code for setting keys as soon as possible 

Java Beginners

getting an error when set classpath
getting an error when set classpath  Hello Everyone! i have used hssf model for reading excel sheet in my project & i have set classpath for that jar file but when i compile the program it will compile correctly but when i 

Servlets

Send Cookies in Servlets
Send Cookies in Servlets   ... in servlets. Cookies are small bits of  information that a Web server sends... and HttpServletResponse interfaces have methods for getting and setting the cookies. You 

Eclipse Plugins

ClassPath Helper
ClassPath Helper     ... with the classpath. Usually it doesn't take long to generate your first... and easily understood. For example if your classpath reads C:\lib\jar1.jar;C:\lib 

General

Class path
the CLASSPATH environment variable. Setting the class path by using the -classpath... the environment variable There is an alternate of the setting the classpath by using the environment. Here we are setting the classpath by using the environment 

Servlets

Installation, Configuration and running Servlets
Installation, Configuration and running Servlets   ... to install a WebServer, configure it and finally run servlets using this server...). This Server supports Java Servlets 2.5 and Java Server Pages (JSPs) 2.1 specifications 

Java Beginners

setting web page size
setting web page size  How to set the webpage size in Java 

Java Beginners

Setting file extension
Setting file extension  Hi, I have used FileChooser to save a file. When I was trying to save it, the extension of the file is showing 'File'. How can I save that file to .xls ? Thanks 

PHP Tutorial

Setting Cookie
Setting Cookie  setcookie function is used for setting up a cookie. In the following example, if you use $_COOKIE command, you will view one cookie value, and if you see print_r ($_COOKIE), you will view all cookie value. We have 

Java Beginners

setting RGB for a circle
setting RGB for a circle  how can i change the color of the circle(not through filling it) and i want to use RGB (not regular colors such as black or red..) i should include RGB numbers (for example 240, 150, 19) but i am 

WebSevices Questions

Setting environment variables
Setting environment variables  Hi, I have a java web application running on jboss AS. 1)How do I set the environment variable in jboss? 2)How do I get the environment variable from jboss 

Java Beginners

Setting File Attributes
Setting File Attributes  I would be glad if anyone could help me set file attributes in java I would like to know how to set the hidden file attribute or the read only file attribute. Thank you 

Java Beginners

Setting File Attributes
Setting File Attributes  I would be glad if anyone could help me set file attributes in java I would like to know how to set the hidden file attribute or the read only file attribute. Thank you 

Java Beginners

Setting File Attributes
Setting File Attributes  I would be glad if anyone could help me set file attributes in java I would like to know how to set the hidden file attribute or the read only file attribute. Thank you   Hi Friend, If you want 

Servlets

How to run a servlet
and setting the classpath click the link Tomcat installation. Set the class for the jar file: Set the classpath of the servlet-api.jar file in the variable CLASSPATH inside the environment variable by using the following steps 

Programming Tutorials

Topic 7: Fundamentals
 

Java Beginners

Setting the default Java character encoding?
Setting the default Java character encoding?  Setting the default Java character encoding 

Java Beginners

Setting File Attributes
Setting File Attributes  I would be glad if anyone could help me set file attributes in java I would like to know how to set the hidden file attribute or the read only file attribute. Thank you   Let me know 

JSP Servlet Questions

jsp -servlets
jsp -servlets  i have servlets s1 in this servlets i have created emplooyee object, other servlets is s2, then how can we find employee information in s2 servlets 

JSP Servlet Questions

path setting - JSP-Servlet
setting this path i need to give the full path from drive name, instead of this if i 

JSP Servlet Questions

path setting - JSP-Servlet
. While setting this path i need to give the full path from drive name, instead 

JSP Servlet Questions

Servlets with Extjs
Servlets with Extjs  how to integrate servlets and extjs and also show database records in extjs grid using servlet how to get servlets json response. Can any one please help me 

Servlet Interview Questions

Authentication in Servlets
Authentication in Servlets  What are different Authentication options available in Servlets 

Advertisements Advertisements
 

 

 

DMCA.com