|
-
Feb 16th, 2002, 07:41 PM
#1
Thread Starter
Hyperactive Member
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
-
Feb 16th, 2002, 07:46 PM
#2
Member
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
-
Feb 16th, 2002, 08:16 PM
#3
Thread Starter
Hyperactive Member
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
-
Feb 16th, 2002, 08:18 PM
#4
Dazed Member
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.
-
Feb 17th, 2002, 01:17 AM
#5
Thread Starter
Hyperactive Member
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.
-
Feb 17th, 2002, 12:45 PM
#6
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|