Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse Java Editor

 
V Bose
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


--Tim
[ July 20, 2004: Message edited by: Tim West ]
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse can change the line delimiters of a file, via Source => Convert line delimiters to => ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic