File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse Java Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse Java Editor" Watch "Eclipse Java Editor" New topic

Eclipse Java Editor

V Bose
Ranch Hand

Joined: Jul 10, 2003
Posts: 113
Is there a way I can specify the file format of a .java file (Mac, PC or Unix) when reading it ? For instance, if I read a java file created on a Mac OS, from a PC, the line temination characters are going to be different...
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
You shouldn't need to. As per the JLS, both Unix and Windows line line termination styles are legal. If a Java editor won't render one of these, it's a bug (at least according to the JLS).

In any case, Eclipse renders either type fine.

As for stripping off Windows-style line terminators when moving files about, I tend to use Emacs for this...I've never had to do enough that I've researched a better way. I imagine there's a single sed command that would do it though

[ July 20, 2004: Message edited by: Tim West ]
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
Eclipse can change the line delimiters of a file, via Source => Convert line delimiters to => ...
I agree. Here's the link:
subject: Eclipse Java Editor
It's not a secret anymore!