-
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
-
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
-
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
-
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. :)
-
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
-
try making the class public b/c the problem may be scope
PS: The Misfits rule