This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buildpath problem with Eclipse

 
David Patterson
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying my first project in Eclipse. I have some existing code I'd like to keep out of Eclipse for now (deciding if I like it first.)

My existing source and class files are organized in a hierarchy that works for me with Ant. I have a directory structure (outside Eclipse)
including a Classpath pointer to \java\localclasses


There are other packages besides utils, but that is the only one I'm trying to use for now.

To get access to it in Eclipse, I've added a ClassPath variable, pointing to the localclasses folder, and added that to the BuildPath. Eclipse cannot find my classes. Much of the help seems to talk about finding "archives" and jar files, but shouldn't the Eclipse realize that a buildpath entry is not a jar, and look below it in the file system for the qualified names of packages being imported?

(My code has several "import com.patterd.utils.whatever" entries that remain flagged as unresolved.)

Thanks for any help.
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried (In Project Properties -> Build Path) Add Library -> User Library -> User Libraries... -> New -> Add the relevant directory? I haven't used it, but it looks like what you want.

The other option, I guess, is to create a separate project with the dubious code, and to link the project. Not sure if this defeats the purpose of the whole exercise.

I'll be interested to hear how you solve this...sounds like one I'll run up against eventually.

Cheers,


--Tim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic