• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

running a class in a package

 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have installed JVM properly? 'cause your consecution is right.
 
Jos� Alberto Mu�iz Navarro
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic