Line Delimiters in Eclipse
Eclipse is an IDE of choice for many. It's been very popular among Java developers for a long time, but lately it is getting some traction in the PHP world, as well. A big contributor has been the absolutely fabulous Eclipse PDT project that makes Eclipse PHP-intelligent.
Whether you are developing in Java, PHP or any other language Eclipse supports, you most probably have to deal with cross-platform issues. One of the most trivial, yet annoying is the matter of line-delimiters. For whatever historical reasons Windows, Unix/Linux and Macintosh use different delimiters. It almost makes you wonder if the creators of the three major operating systems were sadistic enough to intentionally employ all three possible variations to make our lives more difficult.
To avoid ugly problems, it is essential to make sure all developers on a project have the same settings for line-delimiters. Usually, teams use Unix version for two major reasons. First, both Windows and Macintosh understand it and mostly treat well. The second reason is related to version control. Most popular version control systems - CVS and Subversion are usually installed on Unix/Linux. In such case using Unix line delimiting makes sense.
How can we set up Eclipse to use Unix file delimiter even on OS-X or Windows?
To set up default ending for new files created, across the entire workspace:
Window -> Preferences -> General -> Workspace -> New text file line delimiter.
To convert existing files, open file for editing and for the currently edited file, go to the menu:
File -> Convert Line Delimiters To
and select Unix.


File -> Convert Line
File -> Convert Line Delimiters To doesn't work at all!
Eclipse on my machine: Version: 3.2.2
Have you ever encountered my problem?
Thanks.
No, unfortunately I have
No, unfortunately I have never run into that particular problem.
What exactly do you mean by "does not work"? Is it disabled (in that case - do you have file open for editing before you go to the menu?) or it runs but does not do the job? Which operating system?
I have this problem running
I have this problem running 3.3.0 on vista x64.
It just doesn't convert.
Tried it with file open, and with file not open.
Line endings still show as ^M in vi.
Eclipse Europa on XP
Same problem on up-to-date Eclipse Europa in Win XP
Same
having the same problem here.
It needs to be a text file
Check out this link http://www-01.ibm.com/support/docview.wss?rs=79&context=SSJNRR&context=S...
Rename to .txt, then you can do it.
Can not convert to unix line break tags
It does not work on my system.
I have followed all the instructions in the ibm site.
Using: Aptana Studio, build: 1.2.6.024313
(c) Copyright Aptana 2005-2008. All rights reserved.
Workaround
Hi All,
The workaround for this problem is :
1) File menu
2) Select - Convert file delimiters to -> Unix.
This would change all the line break tags to Unix.
Cheers,
Bajrang Gupta
I've recently exchange my
I've recently exchange my desktop for linux and had similar problem, the main being the existing code is currently windows delims.
Opt for changing the versioning tools checkout behaviour in order to prevent too many change/diffs due to eol when checking out existing projects...
Team/CVS/Files and Folders
_Uncheck_ convert text files to use platform line ending
Top western foods
You write a nice blog on computer section. Thanks for sharing your nice views.