Results 1 to 6 of 6

Thread: Java console and Windows XP

  1. #1

    Thread Starter
    Lively Member fundean's Avatar
    Join Date
    Apr 2001
    Posts
    98

    Java console and Windows XP

    Hi All,
    I tried to compile the simple "Hello World" program in my computer under Win XP, and I get this error:

    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main

    the code is as follows:

    public class hello //hello is the fileName
    {
    public static void main(String[] args)
    {
    System.out.println("Starting Java ...");
    System.out.println("Hello World!");
    }
    }

    What am I doing wrong?

    TIA

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Are you using a package directive at the top of the class? I've found that to be tricky when it comes to calling the class from different directories.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Lively Member fundean's Avatar
    Join Date
    Apr 2001
    Posts
    98
    Can you please specify what you mean? I am new to Java. Also, in DOS, when I try to change to the j2sdk1.4.1_01 directory, I get an error:

    C:\>cd j2sdk1.4.1_01
    Invalid directory

    Can you help me with this one too?

    Thanks!

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    fundean you are getting an invalid directory because the directory that you are trying to navigate to dosent exist. At the command prompt i use cd C:\jdk1.3\bin

  5. #5

    Thread Starter
    Lively Member fundean's Avatar
    Join Date
    Apr 2001
    Posts
    98
    There is a directory called j2sdk1.4.1_01; it is Sun's most recent version of the jdk !! My problem in Windows XP is that when I try to go to it, the periods in the directory (or the fact that it is longer than 8 characters?) isn't recognized by DOS.

  6. #6

Posting Permissions

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



Click Here to Expand Forum to Full Width