This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "packages " Watch "packages " New topic
Author

packages

Maha Hassan
Ranch Hand

Joined: Aug 02, 2005
Posts: 133
Dear All,

I am trying to run a file from a package but it does not run. I get the error of NoClassDefFound.
I compile the file with

But when I run it with

I get the error ..

What am I missing ??

Thanks

Maha
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Add -cp ".;..;%CLASSPATH%" also when you run the program:

java -cp ".;..;%CLASSPATH%" Package.fileName


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Maha Hassan
Ranch Hand

Joined: Aug 02, 2005
Posts: 133
I tried
java -cp ".;..;%CLASSPATH%" Package.fileName

And it is working perfectly )
[ September 13, 2007: Message edited by: Maha Hassan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: packages
 
Similar Threads
Cannot build and run Android in NetBeans
Having trouble importing Helliker for a java mp3 player
Regarding package usage
Package Error
Netbeans