• 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

package problems

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to figure out packages and directory structures, and am having problems executing an application that uses a couple of packaged classes ("geometry" is the name of the package). My directory tree includes a D:\practice\geometry (wherein reside Line.java and Point.java, the two classes in the package geometry), and a D:\practice\source, which contains the main program, TryPackages. I can compile the Line class using "javac -classpath D:\practice Line.java" (and similarly for Point), and I can also compile TryPackages.java (which imports the two aforementioned classes using "import geometry.*;"), but when I try to execute TryPackages, I get the following error:
"Exception in thread "main" java.lang.NoClassDefFoundError: TryPackages"
Can someone please tell me what I'm doing wrong?
(sorry for the verbose posting!)
Thanks,
Chris
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this has nothing to do with the Cattle Drive assignments, I'm moving it to Java in General (beginners)
reply
    Bookmark Topic Watch Topic
  • New Topic