Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: compiling the program

  1. #1
    Mayank is offline Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Default compiling the program

    hi i m very new to java n hv just started learning i tried to compile a program but failed
    i wrote my program on notepad which is
    // Hello.java
    import java.util.*;

    public class Hello

    { public static void main(String[] args)

    {
    System.out.println("Hello, it's:");

    system.out.println(new Date());

    }

    }
    n saved it as Hello.java in C:\Program Files (x86)\Java\jdk1.7.0_21\bin
    but when i opened the command prompt and went to the above directory and typed C:\Program Files (x86)\Java\jdk1.7.0_21\bin\javac Hello.java
    as i was instructed i got a msg telling
    "error occurred during initialization of vm
    java/lang/noclassdeffounderror java/lang/Object"


    pls pls pls can someone tell me what am i doing wrong?
    thnx in advance.....pls help

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

    Default Re: compiling the program

    First of all, please use proper spelling and grammar. That's hard enough for me to read, and I'm a native English speaker. Many of our users are not, so using abbreviations actually decreases your chance of getting help- and in the long term, makes you look lazy and unprofessional.

    Why are you putting your class file inside the Java directory? You don't have to do that. Recommended reading: "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application) and Lesson: Common Problems (and Their Solutions) (The Java™ Tutorials > Getting Started)

    Also, please copy and paste the entirety of your command prompt, including everything you type and the entire error message.
    PhHein likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. help me start compiling java program
    By lendix in forum New To Java
    Replies: 3
    Last Post: 01-04-2012, 09:02 AM
  2. Replies: 5
    Last Post: 11-13-2011, 03:58 PM
  3. hi the program is compiling but not running why
    By javastuden in forum New To Java
    Replies: 6
    Last Post: 09-21-2010, 09:14 AM
  4. Poblem in Compiling a c++ file from a java program...
    By Amit Kr. Mishra in forum New To Java
    Replies: 0
    Last Post: 11-06-2007, 10:41 AM
  5. getting problem in compiling java program?
    By sathish04021984 in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 09:26 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
  •