Results 1 to 3 of 3
  1. #1
    chewdoggie is offline Member
    Join Date
    Oct 2013
    Posts
    6
    Rep Power
    0

    Default Error: Could not find or load main class MyJava.java

    Hello All,

    I've loaded some existing .java class files into the Eclipse IDE. In the Package Explorer, the .java files appear under the JRE System Library node. The app compiles fine. I've compiled it in the IDE and on the command line. When I attempt to execute the code, I receive an error: "Editor does not contain a main type".

    I have a MyJava.java file that contains the following:

    public static void main(String[] args) throws Exception {
    .... (code)
    }

    But the IDE doesn't seem to see it. How can I fix this ?

    I've read previous posts for similar errors but those solutions don't seem to help me get past this.

    Thanks !

    Chew

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,916
    Rep Power
    5

    Default Re: Error: Could not find or load main class MyJava.java

    Open up the navigator and see if the .class files are in the bin directory. You may also need to check the build path.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    chewdoggie is offline Member
    Join Date
    Oct 2013
    Posts
    6
    Rep Power
    0

    Default Re: Error: Could not find or load main class MyJava.java

    Thanks, Jim. I got it running.

Similar Threads

  1. Error:Could Not Find or Load Main Class
    By vickyv200 in forum New To Java
    Replies: 3
    Last Post: 08-29-2012, 02:10 AM
  2. Error: could not find or load main class
    By sloppygecko in forum New To Java
    Replies: 3
    Last Post: 08-08-2012, 04:11 PM
  3. Replies: 7
    Last Post: 01-01-2012, 01:29 PM
  4. Replies: 3
    Last Post: 12-09-2011, 04:51 AM
  5. Error: Could not find or load main class Ops.java
    By Javasubbu in forum New To Java
    Replies: 4
    Last Post: 10-05-2011, 11:52 PM

Posting Permissions

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