Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By pbrockway2

Thread: How to compile a Program.

  1. #1
    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Default How to compile a Program.

    Hello Everyone,
    I have made a java file in notepad i.e. "MY.java".
    It is as-
    class string {
    public static void main (string args[]) {
    system.out.println("hello!");
    }
    }
    but in cmd there is error i.e.-
    c:\Users\ojasvi Parashar\Desktop\Java Files>javac my.java
    my.java:3: package system doesnt exist
    system.out.println("hello!");
    ^
    1 error
    c:\Users\ojasvi Parashar\Desktop\Java Files>



    Please Help me...........

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: How to compile a Program.

    You have to be careful about capitalisation in Java. System is not the same as system.

    Furthermore the name of the class and the file that contains its code should agree.

    Perhaps it would be a good idea if you worked carefully through a tutorial example, for example that in Oracle's Tutorial.

  3. #3
    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Default Re: How to compile a Program.

    ya i did it thanx for help.........

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: How to compile a Program.

    You're welcome. I'm glad you've got it to compile.
    ojasviparashar likes this.

  5. #5
    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Default Re: How to compile a Program.

    I m using netbeans 7.0 beta n i m unable to run the program. There is error that no compiler found

Similar Threads

  1. Compile this Program
    By Tink2 in forum New To Java
    Replies: 2
    Last Post: 04-20-2013, 04:37 PM
  2. compile my program
    By suriyababu in forum New To Java
    Replies: 10
    Last Post: 01-31-2013, 12:18 PM
  3. compile my program
    By suriyababu in forum New To Java
    Replies: 1
    Last Post: 01-30-2013, 02:42 PM
  4. i can compile but not run the program???
    By stefandanielsen in forum New To Java
    Replies: 4
    Last Post: 03-10-2011, 12:15 PM
  5. Compile a program
    By toby in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 09:09 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
  •