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

How do I add directories to the classpath in Eclipse?

 
Magnus Falk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the project I'm working on we're reading resource bundles from the classpath and it works fine when doing regular ANT builds. We just put a directory on the classpath and are then able to reference our bundles in the code.

Eclipse however, can't stand the fact that we've included a non-JAR file in the classpath and treats it as an error. Is there a way around this?

Cheers,
Magnus
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compile or runtime classpath?
 
Magnus Falk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime classpath (I think). But I'm pretty sure I've managed to figure it out. It seems to simply be a matter of marking the directory as a source folder (as if it contained Java files) via Project->Build Path->New Source Folder.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That will do it, or you can go to the "Run..." dialog and add it to the classpath for that runnable. But if you're happy, I'm happy.
 
Magnus Falk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I managed to figure that one out before, but the prospect of adding that directory to every single test case relying on that bundle was a bit daunting and I figured that it had to be a better way.

But anyways, it works now so I'm happy =) Thanks for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic