Java.lang no class found error please help

Please can anyone help me to once and for all solve this problem.
I'm using win2k.
jdk1.3.1_01 and apache tomcat 4.0
i can compile but i can't execute any code.
when i try to compile servlet code i get the httpservletpackage does not exist.
regular java code compiles just fine.
The error message below i get whever i try to execute any code.
------- java ----------
java.lang.NoClassDefFoundError: Comparison
Exception in thread "main" Normal Termination
Output completed (1 sec consumed).
This is my CLASSPATH: c:\javax\;c:\unzipped\servlet-2_3-fcs-classfiles\;c:\java;c:\jdk1.3.1_01\server.jar;c:\Apache Tomcat\lib\servlet.jar
My PATH is: c:Apache Tomcat 4.0\common\lib;c:\jdk1.3.1_01\bin;
JAVA_HOME c:\jdk1.3.1_01
TOMCAT_HOME c:\Apache Tomcat 4.0

under DOS, navigate to your current directory that contains the java file you want to compile.
Do the following
1) type in: set classpath=.
(Including the period after the equals sign!)
2) then compile as normal.
This should work.

Similar Messages

  • Javax.servlet.* Not Found Error - Please help

    I am having a great deal deal of trouble trying to compile a program using javax.servlet and javax.servlet.hhtp.*. I have setup the JAVA_HOME and the CLASSPATH variables as per the Installation instructions. I appear to have hit a brick wall and I am absolutely desperate to get this working. I have installed the J2EE SDK as well as the Servletapi2.1. Please Help.
    Variables:
    CLASSPATH=c:\jdk1.3\lib\tools.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\jdk1.3\jre\bin;c:\jdk1.3\jre\lib;c:\mm.mysql-2.0.14\org;c:\jdk1.3\lib\servlet.jar;
    JAVA_HOME=c:\jdk1.3;
    J2EE_HOME=c:\j2sdkee1.3.1;
    PATH=%PATH%;c:\jdk1.3\bin;c:\j2sdkee1.3.1\bin;
    Error message from compiler:
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:27: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:30: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:39: cannot resolve symbol
    symbol : class HttpServlet
    location: class PasswordServlet
    public class PasswordServlet extends HttpServlet

    I can only think of three suggestions.
    One, use your mouse to "cut-n-paste" the value of CLASSPATH and verify that those files are exactly where you think they are, and are spelled right.
    E.g.
    CD C:\JDK1.3\LIB
    DIR SERVLET.JAR
    Two, if they're spelled right, run "jar tvf" on the files to make sure they aren't corrupted or something.
    E.g.:
    JAR TVF SERVLET.JAR
    Three, since you're working in Windoze, try putting the value inside double quotes. E.g.:
    SET CLASSPATH="c:\jdk1.3\lib\tools.jar;c:\j2sdkee1 ... etc ... "
    If you haven't tried the above, give it a go, see what happens.

  • Folder Could Not Be Found Error - Please Help, Don't Want To Re-Edit EVERYTHING!

    So I just edited a huge set of photos.  I put them into a collection, then undid the collection.  But now when I go back to the edited photos in their original location & click develop there is an error saying ""this folder could not be found".  I can see all the pictures & the edits I made in the Library though, so I'm thinking they're still there somewhere.
    When I click on Library, it says they are located in G:\Lily\2010  (but I can't locate this folder G: on my hard drive)
    When I right click & do show in explorer it says there is no file located in this specific path
    I tried re-uploading the unedited pics from my camera into a new folder on C: & then right clicking on the G:\lily\2010 & selecting "find missing folders" & then selecting the newly uploaded unedited pics & that didn't work either.
    Is there something I'm missing here?  How can fix this so I don't have to re-edit all of these photos again?  PLEASE PLEASE HELP!!!  Thanks in advance

    There is no update folder location when I right click....  I'm using LR 3 beta if that matters.  There an update folder location on the far left scrolling menu, which I've tried to do a couple of different ways & it hasn't worked.
    Does anyone know how I can find the G: folder on my computer????  I would try to paste the photos back in that folder if I could find it.

  • Applications server 10g - page cannot be found error please help!!

    hi,
    after installing applications server 10g on windows when i try and access the admin page with the link provided from install and getting started page (http://oracle.itec.local/em) i keep on getting page cannot be displayed error! please help!!

    In the dir where you installed the AS software (mid and infra) there is a sub directory called "install" inside that directory there are two files: portlist.ini and setupinfo.txt .... if you paste there contents I can help you farther

  • Java.lang.NullPointerException.... please help.

    I have been trying to figure out what is wrong with my code, but I have not had any luck. For this program, I used a package called PNGEncoder located here
    http://catcode.com/pngencoder/
    There is a sample code that I tried to follow.
    My code is as follows
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.util.*;
    import java.io.*;
    import com.keypoint.*;
    public class TryShapes extends Frame{
         private int width;
         private int height;
         Image myImage = null;
         private String fileName = "";
         //private int filter = 0;
         //private int compressionLevel = 1;
         //boolean encodeAlpha;
         // Main entry point
    public static void main(String[] args) {
              TryShapes tryShapes =new TryShapes(args[0]);
         public TryShapes(String fileName) {
              System.out.println("This program saves image into file internally.");
              this.fileName = fileName;
              processDrawingFile();
              saveImage();
    private void processDrawingFile(){
         String Instr = null;
    BufferedReader in;
    String fileLocation = "c:\\Drawing files" + File.separator + fileName;
    System.out.println("in start of process file");
    int x, y, r, recWidth, recHeight, x2, y2;     
    // read in file contents
    try{
    in = new BufferedReader(new FileReader(fileLocation));
    //System.out.println("fileLocation");
    Instr = in.readLine(); // the first line of files are titles, skip these
    System.out.println(Instr);
    Instr = in.readLine(); // this is the first line of data (the width & height of bitmap)
    System.out.println(Instr);
    StringTokenizer st = new StringTokenizer(Instr, "\t");
    String s = st.nextToken();
    this.width = Integer.parseInt(s);
    String s2 = st.nextToken();
              this.height = Integer.parseInt(s2);
              System.out.println("width is " + width + " & height is " + height);
              myImage =createImage(width, height);
              System.out.println("after createImage");
    Graphics g;
    g = myImage.getGraphics();
    System.out.println("just after myImage is set to getGraphics");
    while(Instr != null){                 
         Instr = in.readLine(); // read all subsequent lines (elements of the drawing)
         System.out.println(Instr);
    .... and so forth... I used printlines to determine where the program broke and it appears to stop printing after myImage.getGraphics()
    you're help would be much appreciated

    how do i determine if the createImage is not doing what it is suppose to? I'm pretty sure I declared it correctly... java api has
    public Image createImage(int width,
    int height)Creates an off-screen drawable image to be used for double buffering.
    Parameters:
    width - the specified width.
    height - the specified height.
    Returns:
    an off-screen drawable image, which can be used for double buffering.
    and the arguments are integers... what else could be wrong?

  • Error: initialization error: file java\lang\Object.class not found

    when the error listed my classpath's its not the same list that is in my Windows XP environment variable list?
    I am on 9.0.3
    I am assuming I have to set some varible to my new jdk\bin directory. I reinstalled it. I have set it to use jdk 1.4 using the ojvm tool a while back.

    Please help!!
    I did change the jdev.conf file setting:
    SetJavaHome /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home
    and I still get this error:
    initiallization erro: file java/lang/Object.class not found in classpath
    I am usgin Oracle JDeveloper 10g 10.1.2 on a Mac OS X Tiger
    Could someone please help?
    thanks a bunch!!!

  • Error(23,19): method getName(java.lang.String) not found in class javax.swi

    Hi , when i try to run my program, i keep getting the error msg:
    Error(23,19): method getName(java.lang.String) not found in class javax.swing.JTextField
    I have checked the java API and it inherits from the awt.Component class and should be accessible via the jtextfield.
    I have tried the following:
    trying to initailise the JTextField at the start.
    Using getName works if i use it within the loop after setting the name.
    Does anybody know what i am doing wrong please?
    public class clsMember extends JPanel implements ActionListener {
        private JButton jbtnLog;
        private String surname;
        private JTextField txtItem;
        public clsMember() {
            super(new SpringLayout());
            makeInterface();
            surname = txtItem.getName("Surname").toString();
    private void makeInterface() {
         //code omitted
               for (int i = 0; i < numpairs; i++) {
                JLabel l = new JLabel(strLabels, JLabel.LEADING);
    this.add(l);
    //if the array item is salutation create a combobox
    if (strLabels[i] == "Salutation") {
    jcomSalutation = new JComboBox(strSalutation);
    jcomSalutation.setSelectedIndex(0);
    this.add(jcomSalutation);
    } else {
    txtItem = new JTextField(10);
    l.setLabelFor(txtItem);
    txtItem.setName(strLabels[i].replaceAll(" ", "")); //this is where the label is set and if i do a system.out it shows fine. getName works here too.
    this.add(txtItem);
    //code omitted

    If i have a loop that creates the jtextfields such as
                    txtItem = new JTextField(10);
                    l.setLabelFor(txtItem);
                    txtItem.setName(strLabels.replaceAll(" ", ""));
    this.add(txtItem);How is it then possible to assign to a string the value of a *specific jtextfield*. Lets say that one of these JTextfields has the name surname.
    How is it possible for me to writeString surname = surnamejtextfield.getText();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Exception in thread "main" java.lang no class def found error

    hi,
    I am new to java. I have just started using java.I have installed jdk1.3 in my computer and tried to run the following code
    public class NumberCheck
    public static void main(String[] args)
    int number=0;
    number=1+(int)(100*Math.random());
    if(number%2==0)
    System.out.println("You have got an even number"+number);
    else
    System.out.println("You have got an odd number"+number);
    the following code compiles properly but when i use the command java NumberCheck to run the program it shows the above message that no class found error.
    As I am new to programming I dont know what to do. Can anyone please help me about it?

    The Gateway to Classpath Nirvana
    Setting the class path (Windows)
    How Classes are Found
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • Error: invalid file 'java/lang/Object.class' (wrong version: 48, expected 4

    hi all
    ive installed jdk1.4.1 from jdk1.3 .
    When i try to compile a java file i get this error.
    Error: invalid file 'java/lang/Object.class' (wrong version: 48, expected 45)
    anyone has any idea abt this.
    im stuck :( pls help.
    thanks
    Jan

    Did you uninstall 1.3 completely? Completely in the sense both jdk and jre.
    You may get this error if you use javac of one version and the rt.jar of another version.
    Sudha

  • Javah error java.lang.Object not found

    Hi guys-
    I'm trying to run a javah command to generate a .h file... I'm using windows2000 & jdk1.1.8... when I run the command from DOS prompt I keep getting the same eror as java.lang.Object not found: aborting.. I've checked all the classpath and it seems ok ... I have CLASSPATH=..;c:\jdk1.1.8\lib\classes.zip
    Can anybody help me with this???
    Thanx

    Maybe try ; right click my computer ,click the advanced tab and select enviroment variables,click on classpath and then edit,check if it's correct.I had the sam problem and that seemed to fix it. :)

  • Crystal Reports 2013 java-error "java.lang.ClassCastException: class com.crystaldecisions..." when promoting

    Hi,
    when promoting "Crystal Report 2013" report (with data connectivity BW MDX Query) from BO DEV to BO PROD with BO Promotion Mgmt (LCM), we get the following error message in LCM jobs history:
    Resolution Status=Overwritten, Dependency Status=All the required dependencies are included.,
    Commit Status=Commit attempted and failed.,
    Promotion Status=Failure : Object promoted. Update failed.
    Error: java.lang.ClassCastException: class com.crystaldecisions.sdk.occa.report.lib.ByteArray:java.net.URLClassLoader@1d634758 incompatible
    with class com.crystaldecisions.sdk.occa.report.lib.PropertyBag:java.net.URLClassLoader@1d634758
    The report itself is present on BO PROD, but the overwrite (BW DEV MDX Query-> BW PROD MDX Query) is not applied, so report connectivity still points to the BW Query on the development system :-( .
    Moreover, the overwrite itself is detected when the job is "test promoted" ("active overwrite").
    Before, we successfully were able to transport crystal reports 2013 with overwrite (the connection then pointed to BW PROD). No idea yet what suddenly changed that...
    Any ideas what causes the error and what can fix it (no posts found, no SAP note, google also no hits)?
    Best regards
    Florian Pitschi

    Update:
    After more investigation, it looks as if the BO Server "CrystalReports2013ReportApplicationServer"
    from time to time has an issue - not only when promoting, but also when viewing publications that contain Crystal Report documents or when executing them, the java class error or similar issue is thrown.
    Did sb face similar behaviour and knows what is the root cause for "CrystalReports2013ReportApplicationServer" not working probably and throwing the java-class error? - it was running fine for several months, now, the class error showed up twice in one month.
    We need to find out what is causing the issue (aleady checked tomcat and BO-logfiles...).
    Best Regards
    Florian

  • I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    Try popping out the SIM card and turn off the phone.
    Pop in the SIM card once again and turn on the phone, make sure that the SIM card is placed and seated perfectly in the tray!
    Tell me how did you unlock your phone!?

  • Since updating my iPhone 3GS to iOS 4.3.3 I have been unable to sync my photos! Keep getting the error message unable to sync and 'the required file cannot be found.' Please help?

    Since updating my iPhone 3GS to iOS 4.3.3 I have been unable to sync my photos! Keep getting the error message unable to sync and 'the required file cannot be found.' Please help?

    Try deleting the iPod Photo Cache on your computer.
    http://support.apple.com/kb/ts1314

  • HT1390 I rented a movie and it shows up in my iTunes "Rented" section, but when I click to play it, it gives me an error message saying the movie can't be played because the original file can't be found. Please help!

    I rented a movie and it shows up in my iTunes "Rented" section, but when I click to play it, it gives me an error message saying the movie can't be played because the original file can't be found. Please help!

    Never mind I fixed it. Just in case anyone else has this problem, after you reinstall iTunes you have to delete all your old music, and if you have iTunes match all the songs you have saved on itunes match will display and you just have to download them to your Macbook.

  • Error : java.lang.VerifyError: (class: oracle/forms/fd/JCalendarJinit$1,..

    Hi,
    How to solve this error:
    java.lang.VerifyError: (class: oracle/forms/fd/JCalendarJinit$1, method: <init> signature: (Loracle/forms/fd/JCalendarJinit;)V) Expecting to find object/array on stack
         at oracle.forms.fd.JCalendarJinit.<init>(JCalendarJinit.java:66) ............
    I edited the JCalendarJinit.java file for the JCalendar control for the Oracle Forms, I created the jar file, and when using in the forms, i am getting this error when running the oracle form,
    I read, it may be version problem, How can I set the Java version to 1.3 for this java file.
    Thanks in advance,

    Jacob,
    I have received complaints from users, that have got this error on some beans while migrating to Forms 10.1.2.3, even with Sun 1.6 plug-in.
    The beans worked fine with 10.1.2
    Francois

Maybe you are looking for