Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.lineSeparator() doesn't exist in android

Tags:

java

android

System.lineSeparator() is not available when I am doing my Android development. I had to use the older version System.getProperty("line.separator") instead.

Can anyone explain to me why is that? Is it because the Android SDK is not using Java 7?

like image 376
Xi Wei Avatar asked Oct 03 '13 03:10

Xi Wei


1 Answers

Yes, System.lineSeparator() this is a JAVA 1.7 feature. System.getProperty("line.separator") is the correct way to do it pre 1.7

There is an open bug on the oracle site where System.lineSeparator() has not been marked with @Since 1.7. http://bugs.sun.com/view_bug.do?bug_id=7094275

"The new static method lineSeparator() on java.lang.System class is new in java 1.7, so should have the @since 1.7 annotation present in the javadoc."

like image 82
Sean F Avatar answered Oct 03 '22 21:10

Sean F