Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

referring to a file within src folder

 
Neil Tomlin
Greenhorn
Posts: 9
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Eclipse to write/test a program. My JAVA files are all located within the src folder within the Project.

In one of my classes I would like to access a file in my src folder using a relative URI; how can I do this?

I've tried:



None of which appear, to work. Can anyone help me with this?
Thanks
 
Martin Caminoa
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Have you tried
 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you divided your classes into packages?
 
Neil Tomlin
Greenhorn
Posts: 9
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's got it thanks

Thought I had tried it but obviously not.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!