• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Followup Comment to Roy Trock & Marilyn deQueiroz

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roy:
I tried your suggested code exactly as you specified. It compiled both files OK, but when I ran MyTest, I got a run-time error of "NoClassDefFoundError".
I STILL have found only 1 way to get this code to run. That is as I said before, to extend MyClass, and put both files in the SAME package. No other way works! If you have found another way to get these 2 files to run, PLEASE let me know. Thanks!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This looks like a CLASSPATH problem. If you have included the classpath variable with a path to access your first class and have defined the second class in another package without specifying the CLASSPATH for this second class, the class will not be found.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gary, can you post the following?

  • Your JDK version
  • The value of your CLASSPATH (for Oliver, not me; my CLASSPATH is empty and this example still works for me)
  • Directory listings for the directories where you've put the two files in my example. (Note the plural; to reproduce my environment, you've gotta have two source files in two directories, and each directory should have exactly one source file.)

  • Please forgive me if this seems trivial; I want to be sure you've got the proper environment set up before we start digging into other things.
    Bartenders, maybe you can see something obvious that I can't? Or maybe there's a question I'm not asking that I should be asking? Though I've programmed for many years, I am also new to Java, and might not be asking all of the right questions.
    [This message has been edited by Roy Tock (edited July 25, 2001).]
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I just echo Marilyn's request to NOT start a new thread each time you post? It makes it extremely difficult to help you. I've had to look through 5 different threads now, just to track down something you've said in this one.

And please... do what Roy asks in this thread and reply to this thread. Knowing what JDK you are using is very helpful, because as I've mentioned in a previous thread, 1.3 acts very differently regarding packaging and compiling, than every other JDK's. Also, the error messages you get with 1.1.8 and 1.2.2 are differnet for the same problem. As Roy mentions, your CLASSPATH should not cause a problem like this. And as I've also mentioned before, and Roy has repeated... where are your source files?

I apologize if these questions are 'asked and answered', but I guess I got tired of looking through 5 threads looking for your replies. (ok, rant over)
 
reply
    Bookmark Topic Watch Topic
  • New Topic