Results 1 to 2 of 2

Thread: File Won't run

  1. #1
    gameaddict123 is offline Member
    Join Date
    Jan 2011
    Posts
    3
    Rep Power
    0

    Default File Won't run

    This is odd. I compiled HelloWorld.java successfully using javac HelloWorld.java at cmd. Then i typed in java HelloWorld and it says "Could not find main class HelloWorld. Program will exit". What is wrong? Here is the source code:
    class HelloWorld{
    public static void main(String[] args){
    System.out.println("Hello World");
    }
    }

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by gameaddict123 View Post
    This is odd. I compiled HelloWorld.java successfully using javac HelloWorld.java at cmd. Then i typed in java HelloWorld and it says "Could not find main class HelloWorld. Program will exit". What is wrong?
    What did you type exactly when you tried to run your compiled file? Also, are you sure there's a file HelloWorld.class?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 6
    Last Post: 12-01-2010, 06:31 AM
  2. Replies: 0
    Last Post: 07-15-2010, 02:23 PM
  3. Replies: 8
    Last Post: 02-18-2010, 01:54 PM
  4. Replies: 0
    Last Post: 02-11-2009, 10:53 AM
  5. Replies: 7
    Last Post: 05-23-2008, 04:46 AM

Posting Permissions

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