• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packaging help

 
Balaji Anand
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I have written a java code class1.java and have pacakge test; as the first line.

so from the Current_Directlry i compiled using

1. javac -d test class1.java in this care current_directory\test\test\class1.class is created.
I tried running it using
java test.test.class1
2. javac class1.java in this care current_directory\test\class1.class is created
i tried running it using
java test.class1

In both the cases i am getting a NoClassDefFoundError... Can someone help me on how to compile and run a class inside a package?

Where am i going wrong?
Vidhya
 
Sanjaya Sugiarto
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try: java test/class1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic