It's not a secret anymore!
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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>
I agree. Here's the link:
subject: Packaging help
jQuery in Action, 3rd edition