File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes running a class in a package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "running a class in a package" Watch "running a class in a package" New topic
Author

running a class in a package

Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
I have the following dir structure

c:\exam\a\b\c\d

all the class files are in dir d. the package name is c.d

to run class with main method I do the following

c:\exam\a\b java c.d.classWithMain

I get an error saying classNotFoundException for classWithMain

Thank you
Garandi
Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
Do you have installed JVM properly? 'cause your consecution is right.
Jos� Alberto Mu�iz Navarro
Ranch Hand

Joined: Oct 27, 2003
Posts: 33
c:\exam\a\b java c.d.classWithMain

Do you actually say

cd c:\exam\a\b ?

Are you sure your current working directory upon the java call is b?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: running a class in a package
 
Similar Threads
Package
Theoretical doubt from K&B book : File.separator
package urgent!
class not found
Doubt in ch-10(Kathhy Sierra)