As soon as the header asks why System.getProperty ("line.seperator") returns null.
From looking around, I understand that this should not be.
Running this code shows that it seems set when the delimited line is broken:
class Test {
public static void main( String[] args ) {
System.out.println(System.getProperties());
}
}
$ java Test
{java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/i386, java.vm.version=19.1-b02, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http:
, java.vm.specification.vendor=Sun Microsystems Inc., os.name=Linux, (And so on...)
However, when I try to get this in code, I get null:
class Test{
public static void main( String[] args ) {
System.out.println("This is not " + System.getProperty("line.seperator") + "Broken");
}
}
$ java Test
This is not nullBroken
I am using Ubuntu 10.10 and Java (build 1.6.0_24-b07).
thank
source
share