Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-11-2007, 05:20 PM
Member
 
Join Date: Jul 2007
Posts: 23
marco is on a distinguished road
error with JCreator
man JCreator looks nice and is the best IDE i have seen yet, but when i compile applets i ALWAYS get a "Exception in thread "main" java.lang.NoSucHMethodError: main" i know it should work here is the applet template i use:


// The "Applet1" class.
import java.applet.*;
import java.awt.*;

public class Applet1 extends Applet
{


public void init ()
{
setBackground (Color.black);
} // init method


public void paint (Graphics g)
{

} // paint method
} // Applet1 class


the code is all there - dunno why it doesnt work tho
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-12-2007, 12:14 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Hi,

I am not using JCreator for a long time. But the error look familiar to me. I think JCreator tries to execute your class as a java application, not a java applet. For that purpose, it tries to find a main method but can not find it and gives this error.

Create a new Java Applet project and add this class to your new project or try changing runtime details (somehow select to run it as an applet instead of application if it is possible) from your project properties.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-22-2007, 10:15 AM
Member
 
Join Date: Jun 2007
Posts: 7
ramachandran is on a distinguished road
I think you may have not create the html file and my kind advice is to use netbeans to run java...
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 09-20-2008, 05:40 PM
Member
 
Join Date: Sep 2008
Posts: 21
mystified is on a distinguished road
I had a similar error with jcreator..

I saved the filename with a different name from the class name.. It worked when I rectified it.. Try maybe..
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-29-2008, 10:33 PM
Member
 
Join Date: Jan 2008
Posts: 16
AZMichael is on a distinguished road
You can create an easy html file, addit to your project and run from the html, and it loads the applet viewer, no prob.

Alternatively, and even easier:

go to Project (on menu) ->Project Settings ->JDK tools tab -> and for select tool type, choose Run Applet from the drop-down list
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
About using jcreator yuchuang JCreator 4 11-29-2008 10:29 PM
how to enable jcreator to accept command line arguments? Amateur1980 JCreator 1 11-07-2007 04:17 PM
Applet with JCreator baltimore Java Applets 1 08-07-2007 08:38 AM
Executable Application, use JCreator baltimore New To Java 1 07-31-2007 08:03 PM
compilation error with Jcreator Heather JCreator 2 06-30-2007 06:12 PM


All times are GMT +3. The time now is 12:13 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org