The Artima Developer Community
Sponsored Link

Java Answers Forum
help!!!!!!!

4 replies on 1 page. Most recent reply: Oct 14, 2002 4:26 PM by ravikumar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
ravikumar

Posts: 10
Nickname: ji
Registered: Oct, 2002

help!!!!!!! Posted: Oct 14, 2002 10:06 AM
Reply to this message Reply
Advertisement
hi,
i am just learning java and i have a problem. I have 3 files, A.java and B.java and C.java I need to use A and B java file variables in C.java So i wrote package statements like this. all the files are in the "waves" directory.
//in A.java
package waves;
import java.awt.*;
public class A{...
....}
//in B.java
package waves;
public class B{..
...}
// in C.java
package waves;
import java.awt.*;
public class C{....
........}
when i run, i am getting error message as "Exception in thread "main" java.lang.NoClassDefFoundError: B"

i am using linux machine....please help!!!
ji


Don Hill

Posts: 70
Nickname: ssswdon
Registered: Jul, 2002

Re: help!!!!!!! Posted: Oct 14, 2002 10:39 AM
Reply to this message Reply
What type of sandbox are you playing in ?

ravikumar

Posts: 10
Nickname: ji
Registered: Oct, 2002

Re: help!!!!!!! Posted: Oct 14, 2002 11:00 AM
Reply to this message Reply
was anything wrong in my question?

Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: help!!!!!!! Posted: Oct 14, 2002 12:02 PM
Reply to this message Reply
To run the class B you need to write as:

java waves.B

I think you may be writing
java B

when you run a class you need to specify fully-qualified name of your class and not just the simple name. Here, B is simple name and waves.B is fully-qualified name. Again, you also need to set the classpath. Since your package is waves, the parent folder of waves folder should be in classpath. Suppose your waves folder is as:
c:\ravi\waves
Then you need to include c:\ravi in classpath. Alternatively, you can specify classpath when you run the class as:
java -classpath c:\ravi waves.B

Thanks
Kishori

ravikumar

Posts: 10
Nickname: ji
Registered: Oct, 2002

Re: help!!!!!!! Posted: Oct 14, 2002 4:26 PM
Reply to this message Reply
hi ,
thanks for your help...i couldnot run it though i made the changes...actually i need to write a java program in which, if i click on one applet window (say, w1), there is another applet window (say, w2) which gets activated and shows some graph basing on some values from w1 . So i thought that i need to send some values from w1 to w2..hence i created this package thing...is there a simple way or is there anything wrong with my logic?
thanks very much again..

Flat View: This topic has 4 replies on 1 page
Topic: need help please Previous Topic   Next Topic Topic: Printing a vector

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use