Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to read linked Eclipse files?
How to read linked Eclipse files? [message #1835474] Fri, 04 December 2020 05:41
Theme Park is currently offline Theme ParkFriend
Messages: 3
Registered: February 2011
Junior Member
I have set up the projects in my Eclipse workspace so that the src folder for each project is a link to a source folder on a different harddisk, that is network accessible. This means I can work on the projects on different computers, without having to copy the workspace and the source code between them.

Before I set my workspace up this way, I had a normal workspace, and in some of the projects I would need to read some files relative to the source folders, like so:

		BufferedReader in = new BufferedReader(new FileReader(".\\src\\input"));


But now that I have added links to the source folders instead, the above line doesn't work, as it takes "." to be the the root folder of the project in which the code is run.

So my question is now, is there any way I can alter the above code so I can read the file relative to the actual (linked) source code folder on the other disk, and not the project folder? Using an absolute path would defeat the whole purpose, if I work with the code on a Windows machine and a Linux machine, as they have different ways of expressing a file path.

So is it possible to change this code to do what I'd like, or is it impossible to somehow access the linked folder?
Previous Topic:Eclipse 4.15 Freeze when installing JBoss Tools plugin
Next Topic:Shortcut for branch switching?
Goto Forum:
  


Current Time: Wed Apr 24 17:15:12 GMT 2024

Powered by FUDForum. Page generated in 0.02775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top