wood burning stoves
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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "packages " Watch "packages " New topic


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 ??


Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14961

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 8 API documentation
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: packages
It's not a secret anymore!