getStringValue() calls getDisplayText() which in turn uses the OdfWhitespaceProcessor to collect the string parts. But in the process all line breaks will be skipped. The returned string is not the cell content.
multiline.ods
See attached file containing two rows in the first cell.
The following program outputs "first linesecond line":
var ods = OdfSpreadsheetDocument.loadDocument(new File("multiline.ods")); var cell = ods.getSpreadsheetTables().getFirst().getCellByPosition(0, 0); System.out.println(cell.getStringValue());