Results 1 to 6 of 6

Thread: Compile Error?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    Compile Error?

    ok i just downloaded the Java sdk1.1.3 and i tryed to compile a .java file and it gose threw the motions like it makes the .class file but it dosent so . I then type java Hello to see if it works and i get this error :
    "Exception in Thread "main" java.lang.NoClassDefFoundError: Hello/Java "

    Im running window XP if that helps at all

  2. #2
    Do you mean 1.3.1?

    Make sure that your class is called (case sensitive!) Hello, the file "Hello.java", and the output class is "Hello.class".

    Code:
    >javac Hello.java
    >java Hello

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    your Right about the class it wasnt Hello but i changed it and im still getting the same Error

    Code:
    Filename : Hello.java
    
    class Hello {
    	public static void main(String[] arguments){
    				 String greeting = "Saluton mondo!";
    				 System.out.println(greeting);
    		}
    }
    ICQ or AIM me if you or some one knows the problem
    Dviper1020 56186569

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Compile then run using the -classpath switch. An example would be "java -classpath C:\MyJavaFiles; Hello" If you set the CLASSPATH environment variable in the autoexec.bat then you wont need to provide the -classpath switch when running your .class files.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    i dont have a autoexec.bat im winXP i cant find it anywhere

    Ok i fixed it i have to set up the compiler like i would on windows NT i had to right click on my computer and set the property for class and path in their
    Last edited by 308holes; Feb 17th, 2002 at 01:29 AM.

  6. #6
    Hyperactive Member CaptainPinko's Avatar
    Join Date
    Jan 2001
    Location
    London, Ontario, Canada
    Posts
    332
    try making the class public b/c the problem may be scope

    PS: The Misfits rule
    "There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein

    If you are programming in Java use www.NetBeans.org

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