Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

importing root stuff

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am adding a class to an existing project and it makes sense to place it in a different package. The existing numerous classes were not 'packaged' so their class files are in the directory where their java files sit. I want to access one of these classes but I don't know how to get to it. There is no package to import.
How do I get around this problem?
Paul
 
Rick Bos
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the Class has no package, then you have to
put whatever directory you put the .class file
in, in the CLASSPATH.
So, if you decide to put your .class file in a
subdirectory, then that subdirectory has to be in the classpath.
I hope that helps.
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes complete sense to me but I tried it, and it didn't work. I even tried putting the class file itself into the classpath and still no luck.
Any ideas?
Thanks.
Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic