Error...NoSuchMethod: Main???

I am taking a course in Java Networking, but never had Java, and get my four classes to compile and build fine, but when I try to run my client program, I get this error.
java.lang.NoSuchMethodError: main
Exception in thread "main"
No idea what Java means, and have been stuck on this for 3 hours now...Please can anyone help???

set the classpath as follows:
suppose your working directory is C:/files
and your jdk1.4 is located in C directory (C:\jdk1.4), where jdk1.4 is the name of the folder which has a particular version of jdk files and directories.
then do the following
cd C:\filesC:\files> set CLASSPATH=%CLASSPATH%; jdk1.4\lib
C:\files> set CLASSPATH=%CLASSPATH%;C:\files
Hope this solves the problem.
gaurav_k1

Similar Messages

  • Java.lang.NoSuchMethod: main - Help pls

    This is the code i got off a book but it seems like it's not working. I got an error which says 'java.lang.NoSuchMethod: main' Help pls...
    import java.io.*;
    import java.util.*;
    class PostfixInterpreter {
         private String postfixString, outputString;
    private boolean isOperator(char c) {
         return (c == '+' || c == '-' || c == '*' || c == '/' || c == '^' );
    private boolean isSpace(char c) {
         return (c == ' ');
    }//end isSpace
    public void interpretPostfix() {
         Stack evalStack= new Stack();
         double leftOperand, rightOperand;
         char c;
         StringTokenizer parser = new StringTokenizer(postfixString,"+-*/^ ", true);
         while (parser.hasMoreTokens()){
              String token = parser.nextToken();
              c = token.charAt(0);
              if ((token.length() == 1) && isOperator(c)) {
                   rightOperand = ((Double)evalStack.pop()).doubleValue();
                   leftOperand = ((Double)evalStack.pop()).doubleValue();
                   switch (c) {
                        case'+': evalStack.push(new Double(leftOperand+rightOperand));
                                       break;
                        case'-': evalStack.push(new Double(leftOperand-rightOperand));
                                       break;
                        case'*': evalStack.push(new Double(leftOperand*rightOperand));
                                       break;
                        case'/': evalStack.push(new Double(leftOperand/rightOperand));
                                       break;
                        case'^': evalStack.push(new Double(Math.exp(Math.log(leftOperand)*rightOperand)));
                                       break;
                        default:
                                       break;
                   }//end of switch
              }else if((token.length() == 1)&& isSpace(c)){
              }else {
                   evalStack.push(Double.valueOf(token));
              }//end if
         }//end while
    // remove final result from stack and output it
    output("value of postfix expression = " + evalStack.pop());
    }//end interpretPostfix
    private void output(String input){
         postfixString = input;
         }//end setInput
    public String getOutput(){
         return outputString;
    }//end getOutput
    }//end class PostfixInterpreter
    /*Stack class*/
    class Stack {
         private int count;
         private int capacity;
         private int capacityIncrement;
         private Object[] itemArray;
    //the following defines a no-arg constrcutor for Stack objects
    public Stack() {
         count = 0;
         capacity = 100;
         capacityIncrement = 5;
         itemArray = new Object[capacity];
         public boolean empty() {
              return (count ==0);
         public void push(Object X) {
              //if the itemArray does not have enough capacity
              //expend the itemArray by the capacity increment
                   if(count == capacity) {
                        capacity += capacityIncrement;
                        Object[] tempArray = new Object[capacity];
                        for (int i=0; i<count;i++){
                             tempArray[i] = itemArray;
                   itemArray=tempArray;
              //insert the new item X at the end of the current item sequence
              //and increase the stack's count by one
                   itemArray[count++]=X;
    public Object pop() {
         if(count==0){
              return null;
         }else{
              return itemArray[--count];
    }//end of pop()
    public Object peek() {
         if (count == 0){
              return null;
         }else{
              return itemArray[count-1];
    }//end peek()

    First, when posting code in the future, use the code /code tags. Just highlight the code and click the code. button.
    The error probably occurred when you tried to launch the class as an application by entering "java PostfixInterpreter" The java application launcher looks for a method in the PostfixInterpreter class whose signature is exactly public static void main(String[] args)(except 'args' can be any legal variable name). Since your PostfixInterpreter class doesn't have this method, you get the error. If you want this class to run, you have to include the method and code inside the method that runs the application.

  • PA:Error in main

    Hi All,
    Please describe the about error(PA: Error in main).
    I got this error while running the report.
    Please give reply ASAP.
    I hope u understood the needy.
    Thanks
    Surya

    Hi X A H E E R;
    Thanks for notes, great sharing as always Hussein Sawwan
    I do agree with Helios, Real oracle applications king :) I have just one word for Hussein Sawwan... Oracle angle :)
    Helios u are also awesome :)No i am not ;)
    Regard
    Helios

  • JVM 1.4.2_03 error no main class found

    Hello,
    A very strange error encountered "main class not found" on running the application written using JDK 1.4.1_01 on JVM 1.4.2_03 on XP OS. The same application works perfectly well on JVM 1.4.1_01 on XP OS.
    The said application has not been modified since six month and has been working in live environment under JVM 1.4.1_01.
    Any answer to this.
    Thanks
    bhbm

    Sounds like you're trying to run it from a Jar ?
    Eg. java -jar myapp.jar
    Trying running "jar -tf myapp.jar" to see if the jar is still valid / not corrupt.
    Ensure you use the jar command from 1.4.2_03, to validate whether the jar format, manifest information etc can be read using that version.
    regards,
    Owen

  • Found 2 errors in main.css

    Hello, I am building a few sites that are pretty much the same. They have a horizontal menu followed by a Slideshow Pro swf file then some info under the swf file. For some reason items under the swf aren't lining up properly. Things look good in Firefox and Safari but don't work in Opera or IE. Not sure what is going on. I keep getting a message when I check the compatibility and it tells me that there are 2 errors in the main.css although there really isn't much that would cause this problem. I am using padding to place images in certain places. Any help would be great. The site is...
    www.medigitalmedia.com/lexidupont.com
    and the errors I am getting is this...
    Found 2 errors in main.css
    Affects: Firefox 1.5; Internet Explorer 6.0, 7.0; Internet Explorer for Macintosh 5.2; Netscape 8.0; Opera 8.0, 9.0; Safari 2.0
    You will notice that the name on the site does doesn't line up properly in opera and IE
    thanks for you help

    When you see compatibility errors  - put the page through the validators instead:
    You do have to errrors in the stylesheet.
    1.  On the body;  you need to use a unit of measure on the padding  - you only had 25, where it should be 25px.  A 0 can be left as is.
    body {
         background: #FFF url(_images/bg_wood.jpg);
         margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
         padding: 25px 0 0;
         text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
         color: #000000;
         font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 100%;
    In the footer, you omitted to use a hashtag ( # ) in front of a color choice.
    You have     color: a4ce39;
    should be:
    color: #a4ce39;
    The bottom ImagesZ:
    One of the bottom images is inside a div and the other is outside of a div, but was given horizontal-spacing - this won't work as you have seen.
    Instead, place both images inside the div and remove the h-space;
    <div id="bottomName"><img src="http://www.medigitalmedia.com/lexidupont.com/_images/name_topbottom.jpg" alt="nameTop" width="419" height="29" /><img src="http://www.medigitalmedia.com/lexidupont.com/_images/name_bottom.jpg" width="419" height="38" alt="Name" /></div>
      </div>
    On my testing that now looks the same in Firefox and IE7.

  • Automatic Remittances Creation Program (SRS) fails with ARZCAR: Error from main.

    Gurus:
    We have this request that fails - but only at 4am (other scheduled runs it completes fine)
    The error is
    ARZCAR: Error from main.
    Any ideas much apperciated!!
    11.2.0.3
    11.5.10.2
    RHEL 5

    +---------------------------------------------------------------------------+
    Receivables: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    ARZCAR_REMIT_SRS module: Automatic Remittances Creation Program (SRS)
    +---------------------------------------------------------------------------+
    Current system time is 11-NOV-2013 04:00:24
    +---------------------------------------------------------------------------+
      BATCH Date : 2013/11/10 00:00:00
    Convert date parm
    prepay_flag: <N>
    Exception Code <1>
    Batch ID: <>
    main: Error from Batch Id Generation.
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    04:00:24 :Auto Remittance Batch Generation
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    Successfully resubmitted concurrent program ARZCAR_REMIT_SRS with request ID 19366567 to start at 12-NOV-2013 04:00:00 (ROUTINE=AFPSRS)
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Finished executing request completion options.
    ARZCAR: Error from main.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 11-NOV-2013 04:00:24
    +---------------------------------------------------------------------------+

  • Payment Advice errors ( window Main )

    Hi Gurus
    I am generating the payment advice for 2 different vendors based on their 2 different languages.
    CZ - language & EN ( Using the Texts in Recipients Langauge option)
    I am getting the following error during the payment program run with payment advice.
    **Please let me know its to be fixed by the  FI - Functional Person. or ABAP Person. If you know any solution please let me know.  **
    Element TOP window MAIN is not defined for form Z110_CZ_AVIS
    Element MAIN window MAIN is not defined for form Z110_CZ_AVIS
    Element BOTTOM window MAIN is not defined for form Z110_CZ_AVIS
    Message no. TD 427
    Diagnosis: A text element was entered which is not defined in the specified form window.
    System Response:  The function was ignored.
    Procedure: Please specify a text element defined in the form window. You can determine the names of text elements in form windows using the SAPscript form maintenance transaction.

    Hello,
    Please check the language option on the Vendor Master. If this is not impacting, then I would suggest you take help from ABAPer to fix this problem.
    Regards,
    Ravi

  • Runtime Errors SYSTEM_RUDI_INVALID main program /CRYSTAL/PUBLISHER

    Hello,
    we try to publish reports with transaction /CRYSTAL/RPTADMIN.
    If we publish only one report in dialog we don't have problem. Also if we publish a few report in background.
    But if we try to publish more than one report in dialog (publish (F8) or overwrite (F6) we get a runtime error SYSTEM_RUDI_INVALID.
    Extraction from the error:
    Short text
    Invalid addressig handle "RUDI_NULL".
    What happened?
    Error in the SAP kernel.
    The current ABAP "SAPLSH3A" program had to be terminated because the
    ABAP processor detected an internal system error.
    Error analysis
    Invalid runtime object addressed.
    How to correct the error
    The internal system error cannot be fixed by ABAP means only.
    You may be able to find a solution in the SAP note system. If you have
    access to the SAP note system, try searching for the following terms:
    "SYSTEM_RUDI_INVALID" " "
    "SAPLSH3A" or "LSH3AU06"
    "LOGONDATA_GET_A"
    Information on where terminated
    Termination occurred in the ABAP program "SAPLSH3A" - in "LOGONDATA_GET_A".
    The main program was "/CRYSTAL/PUBLISH_WORKER ".
    In the source code you have the termination point in line 1
    of the (Include) program "LSH3AU06".
    We've got a Netweaver 7.02 BW system with Kernel 7.20 PL 86
    We found several notes with the error SYSTEM_RUDI_INVALID, which all are related to kernel patches. But nothing which match to our problem.
    Any ideas?
    Best regards
    Petra Wöritz

    Hi,
    I would suggest you open a message with support so that they can take a look at the system.
    Ingo

  • J2EE Engine startup page error: File [main.jsp] not found in application..

    Hi Guys,
    I have just uninstalled and reinstalled SAP Netweaver 7.01 portal. The uninstall was clean and the reinstall also went without any errors.
    However, immediately after this, when I open http://<host>:<port> I get the following error:
    404   Not Found
    The requested resource /main.jsp is not available
    Details:   File main.jsp not found in application root of alias [/] of J2EE application [sap.com/com.sap.engine.docs.examples].
    If, instead, I open portal (http://<host>:<port>/irj), it works fine.
    Anybody has any idea why this has happened and how can I resolve this issue?
    Thanks,
    Shitij
    Edited by: Shitij Bagga on May 5, 2010 9:36 AM
    Edited by: Shitij Bagga on May 5, 2010 9:37 AM

    Hi Anil,
    I don't see how this note is relevant here. It is just the j2ee engine start page which is not opening. If I go straight to the systeminfo page or the portal login page, they are all working.
    Any experience on this issue with that note u suggested? Please share.
    Thanks,
    Shitij

  • Error in main

    public class Motorcycle
         private String color;
         private String make;
         private String model;
         private String style;
         private int plateNumber;
         private int numberMade;
         private String accessories;
         private String materials;
         private int price;
         private int maxSpeed;
         public Motorcycle()
              color = " Vivid Black";
              make = "Harley Davidson";
              model = "Softail";
              style = "Classic";
              plateNumber = 4561290;
              numberMade = 1000;
              accessories = "Chrome Pipes";
              materials = "Leather & Chrome";
              maxSpeed = 180;
              price = 19765;
         public void setColor(String newColor)
              color = newColor;
         public String getColor()
              return (color);
         public String getMake()
              return (make);
         public String getModel()
              return (model);
         public String getStyle()
              return (style);
         public int getplateNumber()
              return (plateNumber);
         public int getnumbermade()
              return (numberMade);
         public String getAccessories()
              return (accessories);
         public String getMaterials()
              return (materials);
         public int getPrice()
              return (price);
         public String toString()
              return ("Your custom "+make+" :"+color+" "+model+" "+style+
              " license plate number"+plateNumber+" 1 of "+numberMade+" made. With "+
              accessories+" made with "+materials+" with a maximum speed of "+maxSpeed+
              " will cost "+price);
         public static void main(String [] args)
                Motorcycle myMotorcycle = new Motorcycle();
                myMotorcycle.speed();
                System.out.println(myMotorcycle);
    }This is my program, but I get an error in the main method. It says
    cannot resolve symbol
    symbol:method speed ()
    Does anyone have any suggestions on how to fix it

    what can I change it toChange it to Visual Basic... PLEASE!!!I think SBT is going to try an intervention. Iwish
    her well.I agree that the prospect of success is rather
    remote, but if anybody can do it, she can.Yep.
    How is nowhere?Chilly and snowy - and no hockey on TV tonight. :(
    How about you?

  • Static variable error in main function

    Dont know why it would be doing this. It is bascially telling me that every class I call in my main function needs to be static which is crazy.
    import javax.swing.*;
    import java.awt.*;
    class Frame extends JFrame
         public Frame()
              setTitle("My Empty Frame");
              setSize(300,200);
              setLocation(10,200);
              this.show();
    public class Main extends JFrame
         public JFrame frame;
         public Main()
              frame = new JFrame();
         public static void main(String[] args)
              System.out.println("CS348 Project 1");
              frame.setVisible(true); <--------------------ERROR
    }Thanks for the help.

    The problem (basically), is that you could do the following if you felt like it:
    import javax.swing.*;
    import java.awt.*;
    class Frame extends JFrame
         public Frame()
              setTitle("My Empty Frame");
              setSize(300,200);
              setLocation(10,200);
              this.show();
    public class Main extends JFrame
         public JFrame frame;
         public Main()
              frame = new JFrame();
         public static void main(String[] args)
              Main main1 = new Main();
              Main main2 = new Main();
              Main main3 = new Main();
              //what frame is this talking about??
              frame.setVisible(true); <--------------------ERROR
    }What you would want instead is probably something like this:
    Main main1 = new Main();
    main1.getFrame().setVisible(true);This leads to a few other questions: why are you extending JFrame if you have a JFrame variable in the class? Does that class have a JFrame, or is it a JFrame? You should almost definitely go with the "have" answer.

  • Error message Main Spell is not installed

    Error message.....................
    "The Main Spell Dictionary is not installed."
    This happens when using:
    AppleWorks 6.0 through 6.1.2
    The AppleWorks application has been moved from its original folder and now cannot find the Main Spell Dictionary file. Follow these steps to resolve the situation:
    1. Quit AppleWorks.
    2. Move the AppleWorks application program icon back to the AppleWorks 6 folder that was created by the installer.
    3. Open AppleWorks.
    *I tried the above solution and still get the same error message*
    Keywords: kworks ktech

    If you're using any version of AppleWorks before 6.2, you're running the OS 8/9 version. OS X support wasn't added until 6.2. The best versions for use in OS X are 6.2.4 or 6.2.9. Since AppleWorks was designated "end-of-life" it is difficult to find the updaters (especially the US/North American) on Apple's site. Here is the page with the links I have for the 6.2.9 updater. The page has a link to the North American updater in the upper right (the blue 15.8 MB) & links to other languages further down.
    AppleWorks 6.2.9 for Mac
    Whenever you do an update, it's a good idea to do two maintenance tasks, one for the system (Repair Permissions) and one for AppleWorks (delete preferences). (Thanks to Barry for this way to format this very common answer.)
    To Repair permissions, launch Disk Utility, found in the Utilities folder in your Applications folder, click on First Aid, then on Repair Permissions.
    To delete AppleWorks’ preference files, go to HD > Users > (your account) > Library > Preferences. Find and delete the file com.apple.appleworks.plist. Find and open the folder AppleWorks in this Preferences folder, then delete all of the enclosed files (with the exception of the Button Bar Preferences if you have customized the Button Bars). AppleWorks will recreate the preference files as it needs them.

  • Error in main Work flow

    Hi Team,
    After making the changes for copied workflow from the old WF iam struck up with one error saying 'container element WFTASKID'
    is not used.I could not find any element named WFTASKID in main and sub WFlows
    The sub WF is activated and problem comes in the main WF where iam getting one error.I doubt this message is linked to that one error.After copying the main WF and sub WF i did not make any changes except changed the user decision in sub WF,the transactions remains the same.Do you have any idea about this.
    Also i have different versions of main WF like 0001 to 0005,Is there anything to do with the Versions.
    I could not find where exactly the error is.
    Regards,
    Pradeep P

    Hi Arghadeep,
                       Iam working with Expense Approval(HR-Module) for TRIP transaction and BO used is BUS2089.
    There exist a binding for container elment Trip(main WF) and ZZ_Approve_ER(sub WF) for both of these the BO is BUS2089
    but YWORKINGWI is used for Dialog step with the BO 'WORKINGI'.
    YWORKINGWI is present in the sub WF.
    REgards,
    Pradeep P

  • Error NoSuchMethod

    Please help me!!! I am new in java and I tried the next programm:
    import javax.swing.JOptionPane;
    class My_programm {
    int a;
    int b;
    int S;
    public static void main( String args[]) {
    a = Integer.parseInt(JOptionPane.showInputDialog("First num"));
    b = Integer.parseInt(JOptionPane.showInputDialog("Second num"));
    S=a+b;
    System.out.println("The Sum");
    System.out.println(S);
    When I run it, I get the error Exception in thread "main" java.lang.NoSuchMethodError: main
    Please help me

    There are tools which can convert a .class to a .exe but I am not familiar with any of them.
    There is a jar tutorial here: http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
    For the class you posted, the following should work to create an executable jar (I did not test it). I assume the .class file is in the current directory
    1. Create a text file named mainifest .txt in the current directory with the following line. Be sure the file has a blank line at the end.Main-Class:  Programu1_me2. Enter the command, jar cfm Programu1_meu.jar mainifest.txt Programu1_meu.class The jar file should be created.
    3. Test the jar file by entering java -cp Programu1_meu.jar Programu1_meu This validates that you put the class file into the jar properly.
    4. Re-test the jar file by entering java -jar Programu1_meu This validates that you correctly created the manifest.
    5. Test a final time by double clicking. This validates that your system is correctly set up to execute a jar.

  • Error in main program assignment of enhancement

    Hi all,
    I have to create an enhancement in an include RFITEM_INC for tcode FBL1n & FBL3N.
    The objective is to populate data in a newly added field to the output of above transactions.
    For the purpose, enhancement is to be written in same form statement for both the programs, also the code required is same.
    I have created it for one program (FBL3N : RFITEMGL); and now whenever i try to create another enhancement at same location for  other program (FBL1N : RFITEMAP)  the enhancement is created again for the previous program  (RFITEMGL) for which the enhancement alreasy exists.
    Therefore, is there any method to attach same enhancement to two main programs or to successfully create two enhancements at same location attached to two different programs.
    Please note taht I have been able to create it successfully on sandbox but the above problem is occuring on client's server...anything specific?
    Please Help.
    Thanks.
    Edited by: Rekha Singh on Mar 3, 2009 2:03 PM

    answered

Maybe you are looking for

  • Adapter Settlement

    I've got a MacBook with the original power adapter that is showing definite signs of "Stress Relief Damage", and I'm eligible for a replacement.  The site says, "If your Adapter shows signs of Strain Relief Damage now or in the future, you may claim

  • Why are some apps not shown as installed?

    Are apps that were purchased prior to App Store, in my case iWork apps, not going to show as installed on the MAS? Is it only apps installed from MAS that will appear as installed? Olly

  • Numbers 09 - A lot of Data & A lot of Formulas = SLOW

    Hey guys, I am currently using Numbers to graph things from a POS database. I am using an export with about 8100 rows and 6 columns. I am pumping this through A LOT of formulas (about 8000 in a rough count (~40 in a column and 200+ columns)). Most of

  • Email Setup Problem in curve 9220

    Hi... I got my blackberry  9220 curved serviced due to hardware issuesas it was getting restarted again and again . Now while i am trying to setup an email account, there is no option to setup an internet email account only option to setup enterprise

  • How to improve the ODSI deployment process ?

    At at moment we are using the attached script to create new dataspaces and deploy new data services into our environment. Our environment is running 4 managed server cluster in the SUN Unix env. We have noticed the process takes a lot of time. For ex