Java Forum / First Aid / November 2003
[OT] eclipse 'refresh' doesn't work
Alex Hunsley - 27 Nov 2003 10:58 GMT A tad off topic, I hope you won't all hunt me down.
I'm using Eclipse 2.1.2. I edited a java source file outside of eclipse, and have just found out that eclipse caches its copy of the file (d'oh!) Apparently right clicking the file/class and hitting "Refresh" will resync the cached copy with the HD copy, but it just doesn't work. I've tried it with the file open, closed, tried it on the parent folder, I've touched the file in question many time, still no refresh. I've even relaunched eclipse, no effect. It's a simple change that I can manually make in eclipse, but I really want to know for future reference: how do I resync a file with the HD?
thanks alex
Alex Hunsley - 27 Nov 2003 11:25 GMT > A tad off topic, I hope you won't all hunt me down. > [quoted text clipped - 10 lines] > thanks > alex I've just realised that if I make a change to file in eclipse, it doesn't save the change to hard disk, even if I do File -> Save. Arrghh! I need the changes on my hard disk!
alex
Chris Smith - 27 Nov 2003 14:59 GMT > > A tad off topic, I hope you won't all hunt me down. > > [quoted text clipped - 14 lines] > doesn't save the change to hard disk, even if I do File -> Save. > Arrghh! I need the changes on my hard disk! I don't know what to say, except that I've never seen any such thing. Both 'refresh' and 'save' work fine on all versions of Eclipse that I've tried, at least on my system. It would be a really phenomenal bug if they didn't.
When your problem was Refresh, I was going to suggest that perhaps you are just having problems with the incremental builder and aren't checking the source, and that you should look at the source code and then try rebuilding the project if it's correct. That wouldn't solve your "save" problem, though.
Now I'm convinced that, along the lines of what Lutz said, you thing you're working with a different file than you really are. Right-click on the file, select Properties, and see what's listed under "Location" on the properties tab. Is it what you expect?
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Lutz Horn - 27 Nov 2003 11:25 GMT Hi,
* Alex Hunsley <lard@tardis.ed.ac.molar.uk> [27 Nov 2003]:
> I'm using Eclipse 2.1.2. I edited a java source file outside of > eclipse, and have just found out that eclipse caches its copy of [quoted text clipped - 4 lines] > question many time, still no refresh. I've even relaunched > eclipse, no effect. The way you said you do it is the way to go.
Are you *really* sure that you are editing the correct file with the outside tool? Take a look at the project properties for the location of the source files.
Lutz
 Signature no sig
Alex Hunsley - 27 Nov 2003 12:00 GMT > Hi, > [quoted text clipped - 14 lines] > outside tool? Take a look at the project properties for the location of > the source files. I'm pretty sure. I've tried to verify the location of files in eclipse project, but in the Java Build Path section, in the Source tab, if I select my source icon and hit "Edit", it won't tell me in any way where the source files map to the hard drive. How do I see this info? It's a bit opaque like that.... alex
Alex Hunsley - 28 Nov 2003 12:10 GMT >> Hi, >> [quoted text clipped - 21 lines] > bit opaque like that.... > alex Bum. I've checked the properties for a java files and discovered, yes, you guessed it, I'm not editing the real file. Eclipse has made a copy of all my java source files somewhere below the Eclipse install directory. How do I stop it doing this? I remember a checkbox about "Link to the file system", do I have to check this to ensure a copy is not made?
cheers alex
Alex Hunsley - 28 Nov 2003 12:31 GMT >>> Hi, >>> [quoted text clipped - 31 lines] > cheers > alex Ok, I've found out how to do things the way I want them. I've written a reminder for myself in the future, I'm including it here the any benefits of other puzzled souls:
HOWTO: Add your source files to an eclipse project so that you are editing the real files on disk! -----------------------------------------------
Once you have made a project with the right class path etc., do Project menu -> Properties -> Java Build Path. Click "add folder" button at right, ensure your propject is selected in the list and hit "Create new folder". On the window that pops up, click "Advanced" to show advanced options, tick "Link to folder in file system", hit browse and browse to the folder containing your top level class source. For the name of the new folder, you should type a similar name to the top level actual folder on your disk. When you add these files, Eclipse will compile them. It may produce lots of errors, but if it does, it asks you something about adjusting the source location - hit yes, and eclipse will fix things and ask you to recompile again. Answer yes, and you should compile correctly this time.
Chris Smith - 28 Nov 2003 15:32 GMT > Ok, I've found out how to do things the way I want them. > I've written a reminder for myself in the future, I'm including it here > the any benefits of other puzzled souls: Alex,
An easier way to do this is to pass the -data option to Eclipse at startup, telling it where you find your source code. Which you choose depends upon your exact goals. The -data option will require that the directory you specify is set up as Eclipse generally does things (ie, you'll have a metadata directory, and .project files in each dir, etc.). Linking source directories as you explained will give you more flexibility, at the expense of more difficulty in setting it up.
The only real justification I can see for the latter is if you are trying to use Eclipse as some kind of alternate environment but have another product that you use for a lot of your work, and that other product has incompatible requirements for directory layout. That seems unlikely, since Eclipse is a bit big and bulky for a one-use editor.
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|