hi
im a beginner in Java
i have make a simple program using the JCreator LE
but when i execute file the error below is shown in the command prompt
Exception in thread "main" java.lang.NoSuchMethodError: main
may i know what is the matter?
thank you in advance

hello all...

I have just started with java and am having the same trouble..

it compiles alright.. but at runtime.. it gives this error...

can anybody help with how it can be solved...

---> MY CODE<----

import java.applet.*;
import java.awt.*;

public class tutorial extends Applet
{
public void  pain(Graphics g)
    {
    g.drawString("Hello",20,20);
    }
}

Edited 3 Years Ago by pritaeas: Fixed formatting

That means there is no method matching the signature you gave. It could be a parameter missing, a mispelling, or a number of problems.

udit,
you forget the t in paint:

public void pain(Graphics g)

change to;

public void paint(Graphics g)

You might have misspelt the method name or might have referred to a class hat doesn't exist at all. Post you code to pin-point the error exactly.

hi,
does your class has main method with the following signature?

public static void main(String args[])
{
}

regards
srinivas

Hello there,

im begineer too, but i found coding is not the matter, please read JCreator Help Contents, u will find JC doesnt have applet viewer, u must insert manually class filename into html applet template provided, then run that html file as usual, why not switch to TextPad, simple & lightweight yet applet viewer builtin

Hello there,

im begineer too, but i found coding is not the matter, please read JCreator Help Contents, u will find JC doesnt have applet viewer, u must insert manually class filename into html applet template provided, then run that html file as usual, why not switch to TextPad, simple & lightweight yet applet viewer builtin

Unless you're FORCED to use JCreator, try Eclipse. It has everything and then some more..

hey,

me gting d same Error pls help me out with dis....

the program i tried as follows pls refer..
the error is Exceptio in thread "main" java.lang.......

import java.io.*;
class A extends Thread
{
public void run()
{
for(int i=0;i<10;i++)
{
System.out.println("Hello");
}
}
}
class B extends Thread
{
public void run()
{
int i;
for(i=0;i<10;i++)
{
System.out.println("Hi");
}
}
}
class Hiral
{
public static void main (String args[])
{
System.out.println("hello");

A a1=new A();
B b1=new B();
a1.start();
b1.start();
}
}

hey,

me gting d same Error pls help me out with dis....

the program i tried as follows pls refer..
the error is Exceptio in thread "main" java.lang.......

import java.io.*;
class A extends Thread
{
public void run()
{
for(int i=0;i<10;i++)
{
System.out.println("Hello");
}
}
}
class B extends Thread
{
public void run()
{
int i;
for(i=0;i<10;i++)
{
System.out.println("Hi");
}
}
}
class Hiral
{
public static void main (String args[])
{
System.out.println("hello");

A a1=new A();
B b1=new B();
a1.start();
b1.start();
}
}

Please use CODE-tags to post code. It makes it a lot easier to read! Also, try to write better English. It is hard to understand what you write.

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.