Results 1 to 3 of 3
  1. #1
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Exclamation Error could not find or run main class

    I made a breakout like game that runs as a applet and now i wanted to make it run in a jframe so i wrote this
    Java Code:
    import java.applet.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    
    
    public class BrickBuster{
    	public static void main(String[] args){
    		JFrame frame = new JFrame();
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		frame.setVisible(true);
    		JApplet BrickBuster = new JApplet();
    		frame.add(BrickBuster);
    		BrickBuster.init();
    	}
    }
    It compiles fine but whenever i try running it with the java command it says it couldnt find or load main class. also i have it save in a folder called BrickBuster so i called java BrickBuster\BrickBuster.class

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,969
    Rep Power
    8

    Default Re: Error could not find or run main class

    Can you post the exact text of your compile and run commands as well as the error?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: Error could not find or run main class

    Ki compiled with javac BrickBuster/BrickBuster.java and got no errors. When i run it i get errorlkcoulde not find or run main class. But i no longer need this answered my computer crashed and i lost everything

Similar Threads

  1. Error: Could not find or load main class Test.class
    By java_aim in forum New To Java
    Replies: 11
    Last Post: 08-13-2013, 05:05 PM
  2. Error:Could Not Find or Load Main Class
    By vickyv200 in forum New To Java
    Replies: 3
    Last Post: 08-29-2012, 01:10 AM
  3. Could not find the main class error
    By jasper580 in forum New To Java
    Replies: 12
    Last Post: 03-08-2012, 06:02 PM
  4. Error: Could not find or load main class
    By ITSlave in forum New To Java
    Replies: 4
    Last Post: 09-15-2011, 09:47 AM
  5. [SOLVED] Could not find the main class: error...
    By bobleny in forum New To Java
    Replies: 21
    Last Post: 03-02-2010, 10:53 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •