|
-
Feb 18th, 2005, 07:21 AM
#1
Thread Starter
Junior Member
error problem
i am currently running fedora core 3 and it happens to have java 1.4.2 in it. can someone tell me what does this error mean? i have successfully compiled it free of errors but i can't run it :
Exception in thread "main" java.lang.NoClassDefFoundError: Average.java
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
at __gcj_personality_v0 (/home/ezzmir/documents/java.home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre)
at __libc_start_main (/lib/tls/libc-2.3.3.so)
at _Jv_RegisterClasses (/home/ezzmir/documents/java.home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre)
thanks.
-
Feb 18th, 2005, 03:01 PM
#2
Re: error problem
Did you get thouse errors when you ran it in the IDE? If so, are you able to set some break points around, and try to find out what caused it.
Or if the app is not a big secret you might want to attach the app here, so me or someone else can see if we find out. The error message doesn't tell me much. Sorry.
ØØ
-
Feb 18th, 2005, 03:24 PM
#3
Frenzied Member
Re: error problem
Yep, that looks like a classpath/path problem, or you are using a crappy IDE like netbeans.
-
Feb 18th, 2005, 03:27 PM
#4
Re: error problem
 Originally Posted by System_Error
Yep, that looks like a classpath/path problem, or you are using a crappy IDE like netbeans.
I am using NetBeans. At the moment version 4, and I can't complain yet.
ØØ
-
Feb 18th, 2005, 05:50 PM
#5
Frenzied Member
Re: error problem
Well, just my personal opinion.
-
Feb 19th, 2005, 12:14 PM
#6
Thread Starter
Junior Member
Re: error problem
well actually i used the terminal to compile and execute it. it did compile without errors but could not run. or maybe fedora core 3 doesn't have java.io.* class library?
-
Feb 19th, 2005, 01:46 PM
#7
Frenzied Member
Re: error problem
Ok, if it's a runtime exception like that, maybe somethings wrong with your jvm, or your code...Would you mind posting your code?
-
Feb 20th, 2005, 11:24 AM
#8
Re: error problem
How are you calling the program? Do you have any package declarations in the source? Do you have a CLASSPATH environment variable set? What is your directory tree where you have the app?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 20th, 2005, 10:55 PM
#9
Thread Starter
Junior Member
Re: error problem
the code is just like this :
Code:
import java.io.*;
class Average {
public static void main(String[]args) throws IOException {
int num=0, tot=0, ave;
char gra;
while (num<=10) {
System.out.println("input grade ");
gra=(char)System.in.read();
if(gra=='A')
tot+=4;
if(gra=='B')
tot+=3;
if(gra=='C')
tot+=2;
if(gra=='D')
tot+=1;
System.in.skip(2);
num++;
}
ave=tot/num;
System.out.println("Average grade : "+ave);
}
}
another thing guys. if java is a rather platformless language right, then the way we write the code, compile it and declare anything in it should be the same way regardless of the platform right? thanks.
-
Feb 21st, 2005, 03:28 AM
#10
Re: error problem
How do you call the program? And from where? What's your classpath?
Java can be quite confusing to get it running the first time.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|