Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:33:02+00:00 2026-06-17T10:33:02+00:00

I am trying to compile a 4KB Java game called Left 4K Dead.. anyways,

  • 0

I am trying to compile a 4KB Java game called “Left 4K Dead”.. anyways, It will compile successfully with the javac G.java command, but when you go to run it using java G it spits back this error at me:

Exception in thread "main" java.lang.NoSuchMethodError: main

Anyone know how to make this work? Thanks 🙂

Beginning of code:

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.*;

 public class G extends Applet implements Runnable
 {
private boolean[] k = new boolean[32767];
private int m;

public void start()
{
    enableEvents(AWTEvent.KEY_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
    new Thread(this).start();
}

public void run()
{
    BufferedImage image = new BufferedImage(240, 240, BufferedImage.TYPE_INT_RGB);
    Graphics ogr = image.getGraphics();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:33:03+00:00Added an answer on June 17, 2026 at 10:33 am

    Exception in thread “main” java.lang.NoSuchMethodError: main

    This exception indicates exactly what it states, there is no main method, so the program cannot start.

    The issue with the Left 4k Dead code is it is an applet. It expects to be compiled and then run from a webpage, not run from command line (i.e. you can’t run it with the command java). If you wish to run it from the command line, you should look into a standalone applet viewer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to compile and package up my java application but I am facing
Im trying to compile some java files using the Runtime.getRuntime.exec(command) and im generating the
I'm trying to compile the J2ME java files from command line from 2 week
I am trying to compile a Java source file on command prompt with the
Im trying to compile but im getting these errors: 1>.\item.cpp(123) : warning C4800: 'int'
Trying to compile and run a simple Allegro program using Sublime Text 2 and
Trying to compile a Web Project here but I keep on getting package does
I've been trying to compile a Borland C++ Builder 6 project, but linker dies
When trying to compile with boost, everything goes right with Windows, but when I
When trying to compile a c++ file in textmate (this happens when clicking run),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.