This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Packaging help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Packaging help" Watch "Packaging help" New topic

Packaging help

Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
I have written a java code and have pacakge test; as the first line.

so from the Current_Directlry i compiled using

1. javac -d test in this care current_directory\test\test\class1.class is created.
I tried running it using
java test.test.class1
2. javac 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?
Sanjaya Sugiarto
Ranch Hand

Joined: Mar 25, 2004
Posts: 229
Try: java test/class1

<a href="" target="_blank" rel="nofollow">Business Information Technology - Hochschule Furtwangen University, Germany</a>
Consider Paul's rocket mass heater.
subject: Packaging help