Line breaks in Eclipse and Windows

Source: Internet
Author: User

Line breaks in Eclipse and Windows

Line feed identifier of different systems

Windows
Use \ r \ n
Linux/Unix Use \ n
Mac OS Use \ r

FileUtils. writeStringToFile (file, "The first line is \ n. The second line is \ r. The third line is \ n \ r. The fourth line is \ r \ n. \ r \ n the fifth line "); write this part of content to the files in the notepad and Eclipse project directories in windows respectively.
Here is my test data: the first line is \ n the second line is \ r the third line is \ n \ r the fourth line is \ r \ n \ r \ n fifth line

File write results in Eclipse:

The first line is \ n
The second line is \ r.
The third line is \ n \ r.

The fourth line is \ r \ n.
Fifth line

Windows notepad Write result:

The first line is \ n. The second line is \ r. The third line is \ n \ r. The fourth line is \ r \ n.
Fifth line

We can see that \ r \ n is a line feed operation in windows, while \ n, \ r, \ r \ n in Eclipse can achieve line feed, in addition, \ n \ r can be changed to two lines in Eclipse. To ensure that line breaks can be implemented in Eclipse and windows, \ r \ n is recommended (because I use windows ).

From this we can see that Eclipse actually provides support for line breaks in different systems, so any line breaks can be completed in Eclipse, but in the specific system, select.

Hadoop Eclipse plug-in compilation and installation 1.2.0

Compile Hadoop plug-in Eclipse

Hadoop 1.2.1 compile Eclipse plug-in

Install JDK and Eclipse for C/C ++ in Ubuntu 13.10 (solving global menu problems)

How to install the latest Eclipse version in Ubuntu 14.04

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.